#include <Waitable.h>
Public Member Functions | |
void | waitWaiters () |
Block till there are no more waiters in ScopedWaits. | |
size_t | hasWaiters () const |
Returns the number of outstanding ScopedWaits. | |
void | setException (const ExceptionHolder &e) |
Set an execption to interrupt waiters in ScopedWait. | |
bool | hasException () const |
True if the waitable has an exception. | |
void | resetException () |
Clear the exception if any. | |
void | wait () |
Throws an exception if one is set before or during the wait. | |
bool | wait (const AbsTime &absoluteTime) |
Throws an exception if one is set before or during the wait. | |
Classes | |
struct | ScopedWait |
Use this inside a scoped lock around the call to wait() to be counted as a waiter. More... |
Threads declare a ScopedWait around wait() inside a ScopedLock to be considered waiters.
Allows waiting threads to be interrupted by an exception.
Definition at line 38 of file Waitable.h.
void qpid::sys::Waitable::waitWaiters | ( | ) | [inline] |
Block till there are no more waiters in ScopedWaits.
waitWaiters() does not raise an exception even if waiters were interrupted by one.
Definition at line 58 of file Waitable.h.
Referenced by qpid::sys::BlockingQueue< T >::close().
size_t qpid::sys::Waitable::hasWaiters | ( | ) | const [inline] |
Returns the number of outstanding ScopedWaits.
Must be called with the lock held.
Definition at line 66 of file Waitable.h.
void qpid::sys::Waitable::setException | ( | const ExceptionHolder & | e | ) | [inline] |
Set an execption to interrupt waiters in ScopedWait.
Must be called with the lock held.
Definition at line 73 of file Waitable.h.
Referenced by qpid::sys::BlockingQueue< T >::close().
void qpid::sys::Waitable::wait | ( | ) | [inline] |
Throws an exception if one is set before or during the wait.
Reimplemented from qpid::sys::Monitor.
Definition at line 86 of file Waitable.h.
Referenced by qpid::sys::BlockingQueue< T >::pop(), qpid::sys::StateMonitor< qpid::client::SessionImpl::State, DETACHED >::waitFor(), and qpid::sys::StateMonitor< qpid::client::SessionImpl::State, DETACHED >::waitNot().
bool qpid::sys::Waitable::wait | ( | const AbsTime & | absoluteTime | ) | [inline] |
Throws an exception if one is set before or during the wait.
Reimplemented from qpid::sys::Monitor.
Definition at line 92 of file Waitable.h.