summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Scvortov <alexandru@rabbitmq.com>2011-09-14 21:35:05 +0100
committerAlexandru Scvortov <alexandru@rabbitmq.com>2011-09-14 21:35:05 +0100
commit843ddc3518b731caec22115d7b34c2a6499e1750 (patch)
tree6692a4fc476ebf1ca607f7309a62dd72eefb85fb
parente9abddfc8550f335f77d74377c9f364b33393bc7 (diff)
downloadrabbitmq-server-843ddc3518b731caec22115d7b34c2a6499e1750.tar.gz
DeMorgan a case
-rw-r--r--src/rabbit_channel.erl12
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.