summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-12-17 17:23:48 +0000
committerAlan Conway <aconway@apache.org>2008-12-17 17:23:48 +0000
commitef23eec6dfcd906a235e3694b0430f465416727c (patch)
tree97db942d1cc7aa8140172ea8f1bd37db6d2bfe6d
parent95c47fee3cac671dc84d533bd2a5cf28f050da37 (diff)
downloadqpid-python-ef23eec6dfcd906a235e3694b0430f465416727c.tar.gz
Revert accidental commit.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@727447 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/sys/PollableQueue.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/qpid/cpp/src/qpid/sys/PollableQueue.h b/qpid/cpp/src/qpid/sys/PollableQueue.h
index 56c1d9e80a..7f11cc35a9 100644
--- a/qpid/cpp/src/qpid/sys/PollableQueue.h
+++ b/qpid/cpp/src/qpid/sys/PollableQueue.h
@@ -119,15 +119,17 @@ template <class T> void PollableQueue<T>::dispatch(sys::DispatchHandle& h) {
ScopedLock l(lock);
assert(dispatcher.id() == 0);
dispatcher = Thread::current();
- 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();
+ 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();
+ }
}
dispatcher = Thread();
if (queue.empty()) condition.clear();