diff options
Diffstat (limited to 'cpp/src/qpid/sys/ConcurrentQueue.h')
-rw-r--r-- | cpp/src/qpid/sys/ConcurrentQueue.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/cpp/src/qpid/sys/ConcurrentQueue.h b/cpp/src/qpid/sys/ConcurrentQueue.h index cf8199954e..43e82cadce 100644 --- a/cpp/src/qpid/sys/ConcurrentQueue.h +++ b/cpp/src/qpid/sys/ConcurrentQueue.h @@ -79,18 +79,15 @@ template <class T> class ConcurrentQueue : public Waitable { return true; } - /** Wait up to a timeout for a data item to be available. - *@return true if data was available, false if timed out or shut down. - *@throws ShutdownException if the queue is destroyed. + /** Wait for a data item to be available. + * Return false if shut down. */ - bool waitPop(T& data, Duration timeout=TIME_INFINITE) { + bool waitPop(T& data) { ScopedLock l(lock); - AbsTime deadline(now(), timeout); { ScopedWait(*this); while (!shutdownFlag && queue.empty()) - if (!lock.wait(deadline)) - return false; + lock.wait(); } if (queue.empty()) return false; |