Arachne
0.1
|
#include <Arachne.h>
Public Member Functions | |
void | notifyOne () |
void | notifyAll () |
template<typename LockType > | |
void | wait (LockType &lock) |
template<typename LockType > | |
void | waitFor (LockType &lock, uint64_t ns) |
This class enables one or more threads to block until a condition is true, and then be awoken when the condition might be true.
void Arachne::ConditionVariable::notifyAll | ( | ) |
Awaken all of the threads waiting on this condition variable. The caller must hold the mutex that waiting threads held when they called wait().
void Arachne::ConditionVariable::notifyOne | ( | ) |
Awaken one of the threads waiting on this condition variable. The caller must hold the mutex that waiting threads held when they called wait().
void Arachne::ConditionVariable::wait | ( | LockType & | lock | ) |
Block the current thread until the condition variable is notified.
lock | The mutex associated with this condition variable; must be held by caller before calling wait. This function releases the mutex before blocking, and re-acquires it before returning to the user. |
void Arachne::ConditionVariable::waitFor | ( | LockType & | lock, |
uint64_t | ns | ||
) |
Block the current thread until the condition variable is notified or at least ns nanoseconds has passed.
lock | The mutex associated with this condition variable; must be held by caller before calling wait. This function releases the mutex before blocking, and re-acquires it before returning to the user. |
ns | The time in nanoseconds this thread should wait before returning in the absence of a signal. |