diff options
author | Alan Conway <aconway@apache.org> | 2008-07-01 18:01:11 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-07-01 18:01:11 +0000 |
commit | b010894ebe6c468fef0c14ad869b80ef336ab11f (patch) | |
tree | 87fd021e862ad21abffc9457711f066651e67418 /cpp/src/qpid/sys/Waitable.h | |
parent | 4db79de7e806ceba3a243abef9847f15fc41cc40 (diff) | |
download | qpid-python-b010894ebe6c468fef0c14ad869b80ef336ab11f.tar.gz |
Added timeout to SubscriptionManager::get(), LocalQueue::get() and BlockingQueue::get()
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@673158 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/Waitable.h')
-rw-r--r-- | cpp/src/qpid/sys/Waitable.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cpp/src/qpid/sys/Waitable.h b/cpp/src/qpid/sys/Waitable.h index 61b7e7d82b..7701b6f97d 100644 --- a/cpp/src/qpid/sys/Waitable.h +++ b/cpp/src/qpid/sys/Waitable.h @@ -76,6 +76,12 @@ class Waitable : public Monitor { } + /** True if the waitable has an exception */ + bool hasException() const { return exception; } + + /** Clear the exception if any */ + void resetException() { exception.reset(); } + /** Throws an exception if one is set before or during the wait. */ void wait() { ExCheck e(exception); @@ -88,8 +94,6 @@ class Waitable : public Monitor { return Monitor::wait(absoluteTime); } - ExceptionHolder exception; - private: struct ExCheck { const ExceptionHolder& exception; @@ -98,6 +102,8 @@ class Waitable : public Monitor { }; size_t waiters; + ExceptionHolder exception; + friend struct ScopedWait; }; |