#include <Waitable.h>
Inheritance diagram for ZThread::Waitable:
Public Member Functions | |
virtual | ~Waitable () |
Destroy a Waitable object. | |
virtual void | wait ()=0 |
virtual bool | wait (unsigned long timeout)=0 |
Waiting
An object implementing the Waitable interface externalizes a mechanism for testing some internal condition. Another object may wait()s for a Waitable object; in doing so, it wait()s for that condition to become true by blocking the caller while the condition is false.
For example, a Condition is Waitable object that extends wait semantics so that wait()ing means a thread is blocked until some external stimulus specifically performs an operation on the Condition to make its internal condition true. (serialization aside)
A Barrier extends wait semantics so that wait()ing mean waiting for other waiters, and may include automatically resetting the condition once a wait is complete.
virtual bool ZThread::Waitable::wait | ( | unsigned long | timeout | ) | [pure virtual] |
Waiting on an object will generally cause the calling thread to be blocked for some indefinite period of time. The thread executing will not proceed any further until the Waitable object releases it unless or an exception is thrown.
timeout | maximum amount of time, in milliseconds, to spend waiting. |
Implemented in ZThread::Barrier< Count, LockType >, ZThread::ConcurrentExecutor, ZThread::Condition, ZThread::PoolExecutor, ZThread::PriorityCondition, ZThread::SynchronousExecutor, ZThread::Thread, and ZThread::ThreadedExecutor.
virtual void ZThread::Waitable::wait | ( | ) | [pure virtual] |
Waiting on an object will generally cause the calling thread to be blocked for some indefinite period of time. The thread executing will not proceed any further until the Waitable object releases it unless or an exception is thrown.
Implemented in ZThread::Barrier< Count, LockType >, ZThread::ConcurrentExecutor, ZThread::Condition, ZThread::PoolExecutor, ZThread::PriorityCondition, ZThread::SynchronousExecutor, ZThread::Thread, and ZThread::ThreadedExecutor.