From c3c98db893d6e127dc5e0037fb2c3548e8f90a5a Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 12 Jun 2008 19:19:22 +0000 Subject: Propagate error messages across the Demux between network & user threads. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@667205 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/BlockingQueue.h') diff --git a/cpp/src/qpid/sys/BlockingQueue.h b/cpp/src/qpid/sys/BlockingQueue.h index dd709c6bff..86020fad81 100644 --- a/cpp/src/qpid/sys/BlockingQueue.h +++ b/cpp/src/qpid/sys/BlockingQueue.h @@ -79,13 +79,14 @@ public: } /** - * Close the queue. Throws ClosedException in threads waiting in pop(). - * Blocks till all waiting threads have been notified. + * Close the queue. + *@ex exception to throw to waiting threads. ClosedException by default. */ - void close() + void close(const ExceptionHolder& ex=ExceptionHolder(new ClosedException())) { Waitable::ScopedLock l(lock); if (!closed) { + lock.setException(ex); closed = true; lock.notifyAll(); lock.waitWaiters(); // Ensure no threads are still waiting. -- cgit v1.2.1