ILLIXR: Illinois Extended Reality Testbed
Public Member Functions | List of all members
ILLIXR::Event Class Reference

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...
 

Detailed Description

A boolean condition-variable.

Inspired by https://docs.python.org/3/library/threading.html#event-objects

Member Function Documentation

◆ set()

void ILLIXR::Event::set ( bool  new_value = true)
inline

Sets the condition-variable to new_value.

Defaults to true, so that set() sets the bool.

◆ wait_timeout()

template<class Clock , class Rep , class Period >
bool ILLIXR::Event::wait_timeout ( const std::chrono::duration< Rep, Period > &  duration) const
inline

Wait for the event to be set with a timeout.

Returns whether the event was actually set.


The documentation for this class was generated from the following file: