libcommonc++
0.7
|
A condition variable – a synchronization mechanism used to coordinate the actions of multiple threads. More...
#include <ConditionVar.h++>
Public Member Functions | |
ConditionVar () | |
Construct a new ConditionVar. More... | |
~ConditionVar () | |
Destructor. More... | |
bool | wait (Mutex &mutex, uint_t msec=FOREVER) |
Wait for the condition variable to be signalled. More... | |
void | notify () |
Signal one of the threads that are waiting on this condition variable. More... | |
void | notifyAll () |
Signal all threads that are waiting on this condition variable. More... | |
Static Public Attributes | |
static const uint_t | FOREVER = 0 |
A constant representing an infinite wait. More... | |
A condition variable – a synchronization mechanism used to coordinate the actions of multiple threads.
A condition variable is signalled to indicate that the state of some shared data has changed; one or more threads can wait on the condition variable for this change to occur.
ConditionVar | ( | ) |
Construct a new ConditionVar.
~ConditionVar | ( | ) |
Destructor.
void notify | ( | ) |
Signal one of the threads that are waiting on this condition variable.
If predictable scheduling behavior is required, the associated mutex should be held by the thread at the time that it calls this method.
void notifyAll | ( | ) |
Signal all threads that are waiting on this condition variable.
If predictable scheduling behavior is required, the associated mutex should be held by the thread at the time that it calls this method.
Wait for the condition variable to be signalled.
The associated mutex should be held by the thread at the time that it calls this method.
mutex | The mutex that is protecting the shared data; the mutex will be automatically released during the wait and reacquired when the wait completes. |
msec | The amount of time to wait, or FOREVER to wait indefinitely. |
|
static |
A constant representing an infinite wait.