|
cortex 0.0.1
|
A cooperative condition variable. More...
#include <condition_variable.hpp>
Public Member Functions | |
| ConditionVariable ()=default | |
| ~ConditionVariable () | |
| ConditionVariable (const ConditionVariable &)=delete | |
| ConditionVariable & | operator= (const ConditionVariable &)=delete |
| void | Wait (Mutex::Guard &guard) |
| Wait until notified. | |
| template<typename Predicate > | |
| void | Wait (Mutex::Guard &guard, Predicate pred) |
| Wait until notified and predicate is true. | |
| void | NotifyOne () |
| Wake one waiting fiber. | |
| void | NotifyAll () |
| Wake all waiting fibers. | |
A cooperative condition variable.
Allows fibers to wait for a condition to be signaled by another fiber.
|
default |
| cortex::tiny_fiber::ConditionVariable::~ConditionVariable | ( | ) |
|
delete |
| void cortex::tiny_fiber::ConditionVariable::NotifyAll | ( | ) |
Wake all waiting fibers.
| void cortex::tiny_fiber::ConditionVariable::NotifyOne | ( | ) |
Wake one waiting fiber.
|
delete |
| void cortex::tiny_fiber::ConditionVariable::Wait | ( | Mutex::Guard & | guard | ) |
Wait until notified.
The mutex must be locked by the current fiber. It will be unlocked while waiting and re-locked before returning.
| guard | The lock guard holding the mutex. |
|
inline |
Wait until notified and predicate is true.
| guard | The lock guard holding the mutex. |
| pred | The predicate to check. |