qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r727447 - /qpid/trunk/qpid/cpp/src/qpid/sys/PollableQueue.h
Date Wed, 17 Dec 2008 17:23:50 GMT
Author: aconway
Date: Wed Dec 17 09:23:48 2008
New Revision: 727447

URL: http://svn.apache.org/viewvc?rev=727447&view=rev
Log:
Revert accidental commit.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/sys/PollableQueue.h

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/PollableQueue.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/PollableQueue.h?rev=727447&r1=727446&r2=727447&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/PollableQueue.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/PollableQueue.h Wed Dec 17 09:23:48 2008
@@ -119,15 +119,17 @@
     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();



Mime
View raw message