#include <hxthread.hpp>
hxcondition_variable - std::condition_variable style condition variable wrapper for the configured thread backend.
Allows threads to wait for notifications.
◆ hxcondition_variable()
| hxcondition_variable::hxcondition_variable |
( |
void | | ) |
|
|
inline |
Constructs and initializes the condition variable.
◆ ~hxcondition_variable()
| hxcondition_variable::~hxcondition_variable |
( |
void | | ) |
|
|
inline |
Destroys the condition variable if valid.
◆ native_handle()
| inline::cnd_t * hxcondition_variable::native_handle |
( |
void | | ) |
|
|
inline |
Returns a pointer to the native condition variable handle.
◆ notify_all()
| bool hxcondition_variable::notify_all |
( |
void | | ) |
|
|
inline |
Notifies all waiting threads. Returns true on success, false otherwise.
◆ notify_one()
| bool hxcondition_variable::notify_one |
( |
void | | ) |
|
|
inline |
Notifies one waiting thread. Returns true on success, false otherwise.
◆ wait() [1/3]
| bool hxcondition_variable::wait |
( |
hxmutex & | mutex_ | ) |
|
|
inline |
Waits for the condition variable to be notified.
Returns true on success, false otherwise. Callers must check the return value to confirm the wait succeeded.
- mutex : The mutex to use for waiting.
◆ wait() [2/3]
Overload: Waits using a hxunique_lock.
Returns true on success, false otherwise. Callers must check the return value to confirm the wait succeeded.
- lock : The unique lock to use for waiting.
◆ wait() [3/3]
template<typename callable_t_>
| void hxcondition_variable::wait |
( |
hxunique_lock & | lock_, |
|
|
callable_t_ && | callable_ ) |
|
inline |
Waits until the predicate returns true.
- lock : The unique lock to use for waiting.
- callable : Predicate function to check.
The documentation for this class was generated from the following file: