From 7032cd19ced20d2fa37de1263cc9dfa85592b668 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 17 Dec 2008 17:14:14 +0000 Subject: Default --cluster-read-max to 0. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@727444 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/sys/PollableQueue.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'cpp/src/qpid/sys') diff --git a/cpp/src/qpid/sys/PollableQueue.h b/cpp/src/qpid/sys/PollableQueue.h index 7f11cc35a9..56c1d9e80a 100644 --- a/cpp/src/qpid/sys/PollableQueue.h +++ b/cpp/src/qpid/sys/PollableQueue.h @@ -119,17 +119,15 @@ template void PollableQueue::dispatch(sys::DispatchHandle& h) { ScopedLock l(lock); assert(dispatcher.id() == 0); dispatcher = Thread::current(); - while (!stopped && !queue.empty()) { - assert(batch.empty()); - batch.swap(queue); - { - ScopedUnlock u(lock); // Allow concurrent push to queue. - callback(batch); - } - if (!batch.empty()) { - queue.insert(queue.begin(), batch.begin(), batch.end()); // put back unprocessed items. - batch.clear(); - } + assert(batch.empty()); + batch.swap(queue); + { + ScopedUnlock u(lock); // Allow concurrent push to queue. + callback(batch); + } + if (!batch.empty()) { + queue.insert(queue.begin(), batch.begin(), batch.end()); // put back unprocessed items. + batch.clear(); } dispatcher = Thread(); if (queue.empty()) condition.clear(); -- cgit v1.2.1