You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2008/07/29 15:32:29 UTC
svn commit: r680691 -
/incubator/qpid/trunk/qpid/cpp/src/qpid/sys/BlockingQueue.h
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();