ILLIXR: Illinois Extended Reality Testbed
|
A boolean condition-variable. More...
#include <stoplight.hpp>
Public Member Functions | |
void | set (bool new_value=true) |
Sets the condition-variable to new_value. More... | |
void | clear () |
Clears the condition-variable. | |
bool | is_set () const |
Test if is set without blocking. | |
void | wait () const |
Wait indefinitely for the event to be set. | |
template<class Clock , class Rep , class Period > | |
bool | wait_timeout (const std::chrono::duration< Rep, Period > &duration) const |
Wait for the event to be set with a timeout. More... | |
A boolean condition-variable.
Inspired by https://docs.python.org/3/library/threading.html#event-objects
|
inline |
Sets the condition-variable to new_value.
Defaults to true, so that set() sets the bool.
|
inline |
Wait for the event to be set with a timeout.
Returns whether the event was actually set.