UCommon
|
The condition Var allows multiple conditions to share a mutex. More...
#include <condition.h>
Public Member Functions | |
void | broadcast (void) |
Signal the conditional to release all waiting threads. | |
ConditionVar (ConditionMutex *mutex) | |
Initialize and construct conditional. | |
void | signal (void) |
Signal the conditional to release one waiting thread. | |
bool | wait (timeout_t timeout) |
Conditional wait for signal on millisecond timeout. More... | |
bool | wait (struct timespec *timeout) |
Conditional wait for signal on timespec timeout. More... | |
void | wait (void) |
Wait (block) until signalled. | |
~ConditionVar () | |
Destroy conditional, release any blocked threads. | |
Protected Attributes | |
pthread_cond_t | cond |
ConditionMutex * | shared |
Friends | |
class | ConditionList |
The condition Var allows multiple conditions to share a mutex.
This can be used to form specialized thread synchronizing classes such as ordered sempahores, or to create thread completion lists.
Definition at line 148 of file condition.h.
bool ucommon::ConditionVar::wait | ( | timeout_t | timeout | ) |
Conditional wait for signal on millisecond timeout.
timeout | in milliseconds. |
bool ucommon::ConditionVar::wait | ( | struct timespec * | timeout | ) |
Conditional wait for signal on timespec timeout.
timeout | as a high resolution timespec. |