Condition Class Reference
#include <Condition.h>
Inheritance diagram for Condition:
Public Member Functions | |
Condition (Lockable &l) | |
virtual | ~Condition () |
Destroy Condition object. | |
void | signal () |
void | broadcast () |
virtual void | wait () |
virtual bool | wait (unsigned long timeout) |
Detailed Description
- Author:
- Eric Crahen <http://www.code-foo.com>
- Date:
- <2003-07-16T14:38:59-0400>
- Version:
- 2.2.1
Condition objects are reminiscent of POSIX condition variables in several ways but are slightly different.
A Condition is not subject to spurious wakeup.
Like all Waitable objects, Conditions are sensitive to Thread::interupt() which can be used to prematurely end a wait().
- See also:
- Thread::interupt()
A thread blocked by wait() will remain so until an exception occurs, or until the thread awakened by a signal() or broadcast(). When the thread resumes execution, the associated Lockable is acquire()d before wait() returns.
Scheduling
Threads blocked on a Condition are resumed in FIFO order.
Constructor & Destructor Documentation
|
Create a Condition associated with the given Lockable object.
|
Member Function Documentation
|
Wake all threads wait()ing on this Condition. The associated Lockable need not have been acquire when this function is invoked.
|
|
Wake one thread waiting on this Condition. The associated Lockable need not have been acquire when this function is invoked.
|
|
Wait for this Condition, blocking the calling thread until a signal or broadcast is received. This operation atomically releases the associated Lockable and blocks the calling thread.
Implements Waitable. |
|
Wait for this Condition, blocking the calling thread until a signal or broadcast is received. This operation atomically releases the associated Lockable and blocks the calling thread.
Implements Waitable. |
The documentation for this class was generated from the following file:
- Condition.h