summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2010-12-10 09:17:18 +0000
committerGordon Sim <gsim@apache.org>2010-12-10 09:17:18 +0000
commit466c5dc531c7ef4f535a753cd98c611b6e8a0f14 (patch)
treed46228cee374679a6d0eb76f307148ee1b2b7331 /cpp/src/qpid/sys
parent91723b2f5449f4eab8fd4b6db745eb4d97ee7064 (diff)
downloadqpid-python-466c5dc531c7ef4f535a753cd98c611b6e8a0f14.tar.gz
QPID-2966: Add QMF method to dynamically set the log level.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1044248 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys')
-rw-r--r--cpp/src/qpid/sys/BlockingQueue.h6
-rw-r--r--cpp/src/qpid/sys/Waitable.h3
2 files changed, 8 insertions, 1 deletions
diff --git a/cpp/src/qpid/sys/BlockingQueue.h b/cpp/src/qpid/sys/BlockingQueue.h
index 210cb4ad82..ca6b529930 100644
--- a/cpp/src/qpid/sys/BlockingQueue.h
+++ b/cpp/src/qpid/sys/BlockingQueue.h
@@ -53,9 +53,13 @@ public:
Waitable::ScopedWait w(waitable);
if (timeout == TIME_INFINITE) {
while (queue.empty()) waitable.wait();
- } else {
+ } else if (timeout) {
AbsTime deadline(now(),timeout);
while (queue.empty() && deadline > now()) waitable.wait(deadline);
+ } else {
+ //ensure zero timeout pop does not miss the fact that
+ //queue is closed
+ waitable.checkException();
}
}
if (queue.empty()) return false;
diff --git a/cpp/src/qpid/sys/Waitable.h b/cpp/src/qpid/sys/Waitable.h
index 7701b6f97d..8f6bd17049 100644
--- a/cpp/src/qpid/sys/Waitable.h
+++ b/cpp/src/qpid/sys/Waitable.h
@@ -79,6 +79,9 @@ class Waitable : public Monitor {
/** True if the waitable has an exception */
bool hasException() const { return exception; }
+ /** Throws if the waitable has an exception */
+ void checkException() const { exception.raise(); }
+
/** Clear the exception if any */
void resetException() { exception.reset(); }