The condition Var allows multiple conditions to share a mutex.
More...
#include <condition.h>
|
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 (struct timespec *timeout) |
| Conditional wait for signal on timespec timeout.
|
|
bool | wait (timeout_t timeout) |
| Conditional wait for signal on millisecond timeout.
|
|
void | wait (void) |
| Wait (block) until signalled.
|
|
| ~ConditionVar () |
| Destroy conditional, release any blocked threads.
|
|
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.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 148 of file condition.h.
◆ broadcast()
void ucommon::ConditionVar::broadcast |
( |
void | | ) |
|
|
inline |
Signal the conditional to release all waiting threads.
Definition at line 211 of file condition.h.
◆ signal()
void ucommon::ConditionVar::signal |
( |
void | | ) |
|
|
inline |
Signal the conditional to release one waiting thread.
Definition at line 204 of file condition.h.
◆ wait() [1/3]
bool ucommon::ConditionVar::wait |
( |
struct timespec * | timeout | ) |
|
Conditional wait for signal on timespec timeout.
- Parameters
-
timeout | as a high resolution timespec. |
- Returns
- true if signalled, false if timer expired.
◆ wait() [2/3]
bool ucommon::ConditionVar::wait |
( |
timeout_t | timeout | ) |
|
Conditional wait for signal on millisecond timeout.
- Parameters
-
- Returns
- true if signalled, false if timer expired.
◆ wait() [3/3]
void ucommon::ConditionVar::wait |
( |
void | | ) |
|
|
inline |
Wait (block) until signalled.
Definition at line 197 of file condition.h.
◆ ConditionList
friend class ConditionList |
|
friend |
◆ cond
pthread_cond_t ucommon::ConditionVar::cond |
|
mutableprotected |
◆ shared
The documentation for this class was generated from the following file:
- /builddir/build/BUILD/ucommon-7.0.0-build/ucommon-7.0.0/inc/ucommon/condition.h