Equalizer
1.2.1
|
A condition variable and associated lock. More...
#include <condition.h>
Public Member Functions | |
COBASE_API | Condition () |
Construct a new condition variable. | |
COBASE_API | ~Condition () |
Destruct this condition variable. | |
COBASE_API void | lock () |
Lock the mutex. | |
COBASE_API void | unlock () |
Unlock the mutex. | |
COBASE_API void | signal () |
Signal the condition. | |
COBASE_API void | broadcast () |
Broadcast the condition. | |
COBASE_API void | wait () |
Atomically unlock the mutex, wait for a signal and relock the mutex. | |
COBASE_API bool | timedWait (const uint32_t timeout) |
Atomically unlock the mutex, wait for a signal and relock the mutex. |
A condition variable and associated lock.
Follows closely pthread_condition and mutex
Definition at line 35 of file condition.h.
COBASE_API co::base::Condition::Condition | ( | ) |
Construct a new condition variable.
COBASE_API co::base::Condition::~Condition | ( | ) |
Destruct this condition variable.
COBASE_API void co::base::Condition::broadcast | ( | ) |
Broadcast the condition.
Referenced by co::base::Monitor< State >::operator++(), co::base::Monitor< State >::operator--(), co::base::Monitor< State >::operator|=(), and co::base::Monitor< State >::set().
COBASE_API void co::base::Condition::lock | ( | ) |
Lock the mutex.
Referenced by co::base::MTQueue< const void * >::clear(), co::base::MTQueue< const void * >::getBack(), co::base::MTQueue< const void * >::getFront(), co::base::Monitor< State >::operator++(), co::base::Monitor< State >::operator--(), co::base::MTQueue< const void * >::operator=(), co::base::Monitor< State >::operator|=(), co::base::MTQueue< const void * >::pop(), co::base::MTQueue< const void * >::push(), co::base::MTQueue< const void * >::pushFront(), co::base::Monitor< State >::set(), co::base::MTQueue< const void * >::timedPop(), co::base::Monitor< State >::timedWaitEQ(), co::base::Monitor< State >::timedWaitGE(), co::base::MTQueue< const void * >::tryPop(), co::base::Monitor< State >::waitEQ(), co::base::Monitor< State >::waitGE(), co::base::Monitor< State >::waitLE(), co::base::Monitor< State >::waitNE(), and co::base::MTQueue< const void * >::waitSize().
COBASE_API void co::base::Condition::signal | ( | ) |
Signal the condition.
Referenced by co::base::MTQueue< const void * >::operator=(), co::base::MTQueue< const void * >::pop(), co::base::MTQueue< const void * >::push(), co::base::MTQueue< const void * >::pushFront(), co::base::MTQueue< const void * >::timedPop(), and co::base::MTQueue< const void * >::tryPop().
COBASE_API bool co::base::Condition::timedWait | ( | const uint32_t | timeout | ) |
Atomically unlock the mutex, wait for a signal and relock the mutex.
The operation is aborted after the given timeout and false is returned.
timeout | the timeout in milliseconds to wait for the signal. |
Referenced by co::base::MTQueue< const void * >::timedPop(), co::base::Monitor< State >::timedWaitEQ(), and co::base::Monitor< State >::timedWaitGE().
COBASE_API void co::base::Condition::unlock | ( | ) |
Unlock the mutex.
Referenced by co::base::MTQueue< const void * >::clear(), co::base::MTQueue< const void * >::getBack(), co::base::MTQueue< const void * >::getFront(), co::base::Monitor< State >::operator++(), co::base::Monitor< State >::operator--(), co::base::MTQueue< const void * >::operator=(), co::base::Monitor< State >::operator|=(), co::base::MTQueue< const void * >::pop(), co::base::MTQueue< const void * >::push(), co::base::MTQueue< const void * >::pushFront(), co::base::Monitor< State >::set(), co::base::MTQueue< const void * >::timedPop(), co::base::Monitor< State >::timedWaitEQ(), co::base::Monitor< State >::timedWaitGE(), co::base::MTQueue< const void * >::tryPop(), co::base::Monitor< State >::waitEQ(), co::base::Monitor< State >::waitGE(), co::base::Monitor< State >::waitLE(), co::base::Monitor< State >::waitNE(), and co::base::MTQueue< const void * >::waitSize().
COBASE_API void co::base::Condition::wait | ( | ) |
Atomically unlock the mutex, wait for a signal and relock the mutex.
Referenced by co::base::MTQueue< const void * >::pop(), co::base::MTQueue< const void * >::push(), co::base::MTQueue< const void * >::pushFront(), co::base::Monitor< State >::waitEQ(), co::base::Monitor< State >::waitGE(), co::base::Monitor< State >::waitLE(), co::base::Monitor< State >::waitNE(), and co::base::MTQueue< const void * >::waitSize().