summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2010-08-12 05:23:40 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2010-08-12 05:23:40 +0100
commitf1282da0f8e33c7e9305b67cdcf2e9ba03d5c2e3 (patch)
tree7b7a4b0d329c52797f59da0743ecfaefc6681e58
parentb65494db2ac7e5127d0c5ab861525a556ac02e4a (diff)
downloadrabbitmq-server-f1282da0f8e33c7e9305b67cdcf2e9ba03d5c2e3.tar.gz
we must always clear both the 'EXIT' and 'DOWN' message
-rw-r--r--src/supervisor2.erl14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/supervisor2.erl b/src/supervisor2.erl
index 75c4bc11..edd43ec0 100644
--- a/src/supervisor2.erl
+++ b/src/supervisor2.erl
@@ -715,13 +715,13 @@ monitor_child(Pid) ->
receive
%% If the child dies before the unlik we must empty
%% the mail-box of the 'EXIT'-message and the 'DOWN'-message.
- {'EXIT', Pid, Reason} ->
- case Reason of
- normal -> ok;
- _ -> receive
- {'DOWN', _, process, Pid, _} ->
- {error, Reason}
- end
+ {'EXIT', Pid, Reason} ->
+ receive
+ {'DOWN', _, process, Pid, _} ->
+ case Reason of
+ normal -> ok;
+ _ -> {error, Reason}
+ end
end
after 0 ->
%% If a naughty child did unlink and the child dies before