qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r680691 - /incubator/qpid/trunk/qpid/cpp/src/qpid/sys/BlockingQueue.h
Date Tue, 29 Jul 2008 13:32:29 GMT
Author: astitcher
Date: Tue Jul 29 06:32:29 2008
New Revision: 680691

URL: http://svn.apache.org/viewvc?rev=680691&view=rev
Log:
Fix for client busy looping whilst waiting for a message

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/sys/BlockingQueue.h

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/sys/BlockingQueue.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/sys/BlockingQueue.h?rev=680691&r1=680690&r2=680691&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/sys/BlockingQueue.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/sys/BlockingQueue.h Tue Jul 29 06:32:29 2008
@@ -51,8 +51,12 @@
         Mutex::ScopedLock l(waitable);
         {
             Waitable::ScopedWait w(waitable);
-            AbsTime deadline(now(),timeout);
-            while (queue.empty() && deadline > now()) waitable.wait(deadline);
+            if (timeout == TIME_INFINITE) {
+                while (queue.empty()) waitable.wait();
+            } else {
+                AbsTime deadline(now(),timeout);
+                while (queue.empty() && deadline > now()) waitable.wait(deadline);
+            }
         }
         if (queue.empty()) return false;
         result = queue.front();



Mime
View raw message