summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys/BlockingQueue.h
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-11-06 22:40:57 +0000
committerAlan Conway <aconway@apache.org>2008-11-06 22:40:57 +0000
commit17716fee99670e49a1c3526a44c40d15757d94e3 (patch)
treea61a44820b9ee72d920a65f3d5683585b652fa76 /cpp/src/qpid/sys/BlockingQueue.h
parent2de0473cf8c64e06396c5f5e6a0cf8b5e982514e (diff)
downloadqpid-python-17716fee99670e49a1c3526a44c40d15757d94e3.tar.gz
Add Message callbacks for async completion.
Add unit test for async completion. Add sync parameter to generated session functions, defaults as before but allows greater control. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@711998 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/BlockingQueue.h')
-rw-r--r--cpp/src/qpid/sys/BlockingQueue.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/cpp/src/qpid/sys/BlockingQueue.h b/cpp/src/qpid/sys/BlockingQueue.h
index d7e6449d7a..a05a10d811 100644
--- a/cpp/src/qpid/sys/BlockingQueue.h
+++ b/cpp/src/qpid/sys/BlockingQueue.h
@@ -66,10 +66,11 @@ public:
return true;
}
- T pop() {
+ T pop(Duration timeout=TIME_INFINITE) {
T result;
- bool ok = pop(result);
- assert(ok); (void) ok; // Infinite wait.
+ bool ok = pop(result, timeout);
+ if (!ok)
+ throw Exception("Timed out waiting on a blocking queue");
return result;
}