summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2014-06-03 19:04:39 +0000
committerGordon Sim <gsim@apache.org>2014-06-03 19:04:39 +0000
commitd45b5f6510da0e0d0f925bf8e9e443bd7d50bf3c (patch)
treeb69849c91163a1820b11d0211ba74d54139a0351 /qpid/cpp/src
parentf418f3407dd6e080d2c4234e75ab6813f2ace4ea (diff)
downloadqpid-python-d45b5f6510da0e0d0f925bf8e9e443bd7d50bf3c.tar.gz
QPID-5793: prevent deadlock between timer and consume
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1599765 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/broker/Queue.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/broker/Queue.cpp b/qpid/cpp/src/qpid/broker/Queue.cpp
index 78ee37607e..e91123eb6a 100644
--- a/qpid/cpp/src/qpid/broker/Queue.cpp
+++ b/qpid/cpp/src/qpid/broker/Queue.cpp
@@ -540,6 +540,7 @@ void Queue::consume(Consumer::shared_ptr c, bool requestExclusive,
const framing::FieldTable& arguments,
const std::string& connectionId, const std::string& userId)
{
+ boost::intrusive_ptr<qpid::sys::TimerTask> t;
{
Mutex::ScopedLock locker(messageLock);
if (c->preAcquires()) {
@@ -568,12 +569,13 @@ void Queue::consume(Consumer::shared_ptr c, bool requestExclusive,
if(c->isCounted()) {
//reset auto deletion timer if necessary
if (settings.autoDeleteDelay && autoDeleteTask) {
- autoDeleteTask->cancel();
+ t = autoDeleteTask;
}
observeConsumerAdd(*c, locker);
}
}
+ if (t) t->cancel();
if (mgmtObject != 0 && c->isCounted()) {
mgmtObject->inc_consumerCount();
}