|
|
This class realizes a condition variable.
See also: Synchronizable, Thread
Condition (const char* name = "Condition",
Condition* parentCondition = NULL)
| Condition |
Constructor.
Parameters:
name | Name. |
parentCondition | Parent condition. |
~Condition ()
| ~Condition |
Destructor.
inline void signal ()
| signal |
Fire condition: One thread waiting for this variable will be resumed.
inline void broadcast ()
| broadcast |
Broadcast condition: All threads waiting for this variable will be resumed.
inline bool fired ()
| fired |
Check, if condition has been fired.
Returns: true, if condition has been fired; false otherwise.
inline void wait ()
| wait |
Wait for condition without timeout.
bool timedWait (const card64 microseconds)
| timedWait |
Wait for condition with timeout.
Parameters:
microseconds | Timeout in microseconds. |
Returns: true, if condition has been received; false for timeout.
void addParent (Condition* parentCondition)
| addParent |
Add parent condition.
Parameters:
parentCondition | Parent condition to be added. |
void removeParent (Condition* parentCondition)
| removeParent |
Remove parent condition.
Parameters:
parentCondition | Parent condition to be removed. |