summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2010-08-17 12:20:22 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2010-08-17 12:20:22 +0100
commit9f77d136b45992c812311962d762f1c10e87d01d (patch)
tree257d1e863c0fb0cfcf671bf2998b1950e888287e
parent4736f0d828163a1053beddab90bc73ca68832e60 (diff)
downloadrabbitmq-server-git-9f77d136b45992c812311962d762f1c10e87d01d.tar.gz
Minor corrections
-rw-r--r--src/file_handle_cache.erl9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/file_handle_cache.erl b/src/file_handle_cache.erl
index 2014b19f56..19b2654f59 100644
--- a/src/file_handle_cache.erl
+++ b/src/file_handle_cache.erl
@@ -767,17 +767,18 @@ handle_call({obtain, Pid}, From, State = #fhc_state { obtain_count = Count,
handle_call({open, Pid, EldestUnusedSince, CanClose}, From,
State = #fhc_state { open_count = Count,
open_pending = Pending,
- elders = Elders }) ->
+ elders = Elders }) ->
Elders1 = dict:store(Pid, EldestUnusedSince, Elders),
- case maybe_reduce(State #fhc_state { open_count = Count + 1,
- elders = Elders1 }) of
+ case maybe_reduce(
+ ensure_mref(Pid, State #fhc_state { open_count = Count + 1,
+ elders = Elders1 })) of
{true, State1} ->
State2 = State1 #fhc_state { open_count = Count },
case CanClose of
true -> {reply, close, State2};
false -> {noreply, State2 #fhc_state {
open_pending = [From | Pending],
- elders = Elders }}
+ elders = dict:erase(Pid, Elders1) }}
end;
{false, State1} ->
{reply, ok, State1}