diff options
author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-09-14 21:35:05 +0100 |
---|---|---|
committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-09-14 21:35:05 +0100 |
commit | 843ddc3518b731caec22115d7b34c2a6499e1750 (patch) | |
tree | 6692a4fc476ebf1ca607f7309a62dd72eefb85fb | |
parent | e9abddfc8550f335f77d74377c9f364b33393bc7 (diff) | |
download | rabbitmq-server-843ddc3518b731caec22115d7b34c2a6499e1750.tar.gz |
DeMorgan a case
-rw-r--r-- | src/rabbit_channel.erl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index a0d7fe79..861a3b3a 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -1146,18 +1146,20 @@ consumer_monitor(ConsumerTag, demonitor_queue(QPid, #ch{stats_timer = StatsTimer, consumer_monitors = ConsumerMonitors, - blocking = Blocking}) -> + blocking = Blocking, + unconfirmed_qm = UQM}) -> case get({monitoring, QPid}) of undefined -> ok; MRef -> StatsEnabled = rabbit_event:stats_level(StatsTimer) =:= fine, ConsumerMonitored = dict:find(MRef, ConsumerMonitors) =/= error, QueueBlocked = gb_sets:is_element(QPid, Blocking), - case not StatsEnabled and not ConsumerMonitored and - not QueueBlocked of - true -> true = erlang:demonitor(MRef), + ConfirmMonitored = gb_trees:is_defined(QPid, UQM), + case StatsEnabled or ConsumerMonitored or + QueueBlocked or ConfirmMonitored of + false -> true = erlang:demonitor(MRef), erase({monitoring, QPid}); - false -> ok + true -> ok end, ok end. |