C++11 compliant implementation of condition variable, uses the time point implemented in our chrono replacement instead of the specified one. More...
C++11 compliant implementation of condition variable, uses the time point implemented in our chrono replacement instead of the specified one.
Definition at line 52 of file condition_variable.hpp.
#include <condition_variable.hpp>
Public Types | |
using | native_handle_type = priority_queue_t * |
The native handle type used by the condition variable. | |
Public Member Functions | |
void | notify_one () noexcept |
Notify one thread waiting on this condition. | |
void | notify_all () noexcept |
Notify all threads waiting on this condition variable. | |
void | wait (unique_lock< mutex > &lock) noexcept |
Block until woken up through the condition variable. | |
template<class Predicate > | |
void | wait (unique_lock< mutex > &lock, Predicate pred) |
Block until woken up through the condition variable and a predicate is fulfilled. | |
cv_status | wait_until (unique_lock< mutex > &lock, const time_point &timeout_time) |
Block until woken up through the condition variable or a specified point in time is reached. | |
template<class Predicate > | |
bool | wait_until (unique_lock< mutex > &lock, const time_point &timeout_time, Predicate pred) |
Block until woken up through the condition variable and a predicate is fulfilled or a specified point in time is reached. | |
template<class Rep , class Period > | |
cv_status | wait_for (unique_lock< mutex > &lock, const std::chrono::duration< Rep, Period > &rel_time) |
Blocks until woken up through the condition variable or when the thread has been blocked for a certain time. | |
template<class Rep , class Period , class Predicate > | |
bool | wait_for (unique_lock< mutex > &lock, const std::chrono::duration< Rep, Period > &rel_time, Predicate pred) |
Blocks until woken up through the condition variable and a predicate is fulfilled or when the thread has been blocked for a certain time. | |
native_handle_type | native_handle () |
Returns the native handle of the condition variable. | |
The native handle type used by the condition variable.
Definition at line 57 of file condition_variable.hpp.
|
inline |
Definition at line 58 of file condition_variable.hpp.
|
inline |
Returns the native handle of the condition variable.
Definition at line 137 of file condition_variable.hpp.
|
noexcept |
Block until woken up through the condition variable.
lock | A lock that is locked by the current thread. |
void riot::condition_variable::wait | ( | unique_lock< mutex > & | lock, |
Predicate | pred | ||
) |
Block until woken up through the condition variable and a predicate is fulfilled.
lock | A lock that is locked by the current thread. |
pred | A predicate that returns a bool to signify if the thread should continue to wait when woken up through the cv. |
Definition at line 147 of file condition_variable.hpp.
cv_status riot::condition_variable::wait_for | ( | unique_lock< mutex > & | lock, |
const std::chrono::duration< Rep, Period > & | rel_time | ||
) |
Blocks until woken up through the condition variable or when the thread has been blocked for a certain time.
lock | A lock that is locked by the current thread. |
rel_time | The maximum time spent blocking. |
Definition at line 166 of file condition_variable.hpp.
|
inline |
Blocks until woken up through the condition variable and a predicate is fulfilled or when the thread has been blocked for a certain time.
lock | A lock that is locked by the current thread. |
rel_time | The maximum time spent blocking. |
pred | A predicate that returns a bool to signify if the thread should continue to wait when woken up through the cv. |
Definition at line 189 of file condition_variable.hpp.
cv_status riot::condition_variable::wait_until | ( | unique_lock< mutex > & | lock, |
const time_point & | timeout_time | ||
) |
Block until woken up through the condition variable or a specified point in time is reached.
The lock is reacquired either way.
lock | A lock that is locked by the current thread. |
timeout_time | Point in time when the thread is woken up independently of the condition variable. |
bool riot::condition_variable::wait_until | ( | unique_lock< mutex > & | lock, |
const time_point & | timeout_time, | ||
Predicate | pred | ||
) |
Block until woken up through the condition variable and a predicate is fulfilled or a specified point in time is reached.
The lock is reacquired either way.
lock | A lock that is locked by the current thread. |
timeout_time | Point in time when the thread is woken up independently of the condition variable. |
pred | A predicate that returns a bool to signify if the thread should continue to wait when woken up through the cv. |
Definition at line 154 of file condition_variable.hpp.