diff options
Diffstat (limited to 'cpp/src/qpid/broker/BrokerQueue.cpp')
-rw-r--r-- | cpp/src/qpid/broker/BrokerQueue.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/BrokerQueue.cpp b/cpp/src/qpid/broker/BrokerQueue.cpp index d96622cd4f..29e2256b56 100644 --- a/cpp/src/qpid/broker/BrokerQueue.cpp +++ b/cpp/src/qpid/broker/BrokerQueue.cpp @@ -126,6 +126,7 @@ bool Queue::acquire(const QueuedMessage& msg) { void Queue::requestDispatch(Consumer* c, bool sync){ if (!c || c->preAcquires()) { if (sync) { + Mutex::ScopedLock locker(messageLock); dispatch(); } else { serializer.execute(dispatchCallback); @@ -153,7 +154,9 @@ bool Queue::dispatch(QueuedMessage& msg){ int start = next; while(c){ next++; - if(c->deliver(msg)) return true; + if(c->deliver(msg)) { + return true; + } next = next % acquirers.size(); c = next == start ? 0 : acquirers[next]; } |