diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2008-07-29 13:32:29 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2008-07-29 13:32:29 +0000 |
| commit | cc6b09471a907bbe6c94329582c43efe334c9197 (patch) | |
| tree | cc80f11a4d87e3751766ae4b8967c488d23670ed /qpid/cpp/src | |
| parent | 7bcbdf3bb60ef8932bf90935c2d53349fdf11d14 (diff) | |
| download | qpid-python-cc6b09471a907bbe6c94329582c43efe334c9197.tar.gz | |
Fix for client busy looping whilst waiting for a message
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@680691 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/sys/BlockingQueue.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/sys/BlockingQueue.h b/qpid/cpp/src/qpid/sys/BlockingQueue.h index 4402c242e6..c6c6291b97 100644 --- a/qpid/cpp/src/qpid/sys/BlockingQueue.h +++ b/qpid/cpp/src/qpid/sys/BlockingQueue.h @@ -51,8 +51,12 @@ public: 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(); |
