#include <thread.h>
Public Member Functions | |
Condition () | |
~Condition () | |
void | signal () |
void | broadcast () |
void | wait (Mutex &m) |
bool | wait (Mutex &m, const TimeVal &tmout) |
bool | wait (Mutex &m, unsigned long tmout) |
A class representing a condition that can be waited upon.
SigCX::Threads::Condition::Condition | ( | ) |
Constructor.
SigCX::Threads::Condition::~Condition | ( | ) |
Destructor.
void SigCX::Threads::Condition::signal | ( | ) |
Signal condition.
Restarts exactly one thread hung on condition.
void SigCX::Threads::Condition::broadcast | ( | ) |
Broadcast condition.
Restarts all threads waiting on condition.
void SigCX::Threads::Condition::wait | ( | Mutex & | m | ) |
Wait for condition.
Unlocks a mutex while waiting on a condition, then reaquires lock.
m | Mutex to act upon. |
Timed wait.
Unlocks a mutex while waiting on a condition, then reaquires lock with a fixed maximum duration.
m | Mutex to act upon. | |
tmout | The maximum time interval to wait for the condition. |
true
if woken up in time. bool SigCX::Threads::Condition::wait | ( | Mutex & | m, | |
unsigned long | tmout | |||
) | [inline] |
Timed wait.
Unlocks a mutex while waiting on a condition, then reaquires lock with a fixed maximum duration.
m | Mutex to act upon. | |
tmout | The maximum time interval in microseconds to wait for the condition. |
true
if woken up in time.