From 17716fee99670e49a1c3526a44c40d15757d94e3 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 6 Nov 2008 22:40:57 +0000 Subject: 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 --- cpp/src/qpid/sys/BlockingQueue.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cpp/src/qpid/sys') 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; } -- cgit v1.2.1