libfilezilla
|
Waitable condition variable. More...
#include <mutex.hpp>
Public Member Functions | |
condition (condition const &)=delete | |
condition & | operator= (condition const &)=delete |
void | wait (scoped_lock &l) |
Wait indefinitely for condition to become signalled. More... | |
bool | wait (scoped_lock &l, duration const &timeout) |
Wait until timeout for condition to become signalled. More... | |
void | signal (scoped_lock &l) |
Signal condition variable. More... | |
bool | signalled (scoped_lock const &) const |
Check if condition is already signalled. More... | |
Waitable condition variable.
Allows one thread to wait for the condition variable to become signalled by another thread.
void signal | ( | scoped_lock & | l | ) |
Signal condition variable.
To avoid race conditions leading to lost signals, you must pass a locked mutex.
|
inline |
Check if condition is already signalled.
To avoid race conditions leading to lost signals, you must pass a locked mutex.
void wait | ( | scoped_lock & | l | ) |
Wait indefinitely for condition to become signalled.
Atomically unlocks the mutex and waits for the condition. Atomically consumes the signal and re-locks the mutex.
bool wait | ( | scoped_lock & | l, |
duration const & | timeout | ||
) |
Wait until timeout for condition to become signalled.
Atomically unlocks the mutex and waits for the condition. Atomically consumes the signal and re-locks the mutex.