Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
arene::base::manual_reset_event Class Reference

An event class that allows blocking waits from an arbitrary number of threads that are then woken when the event is signalled. Additional calls to wait while the event is signalled will return immediately. If there are no waiting threads, the event can be reset to an unsignalled state. More...

Public Member Functions

constexpr manual_reset_event () noexcept=default
 Initialize the event to an unsignalled state.
 
 manual_reset_event (manual_reset_event &&)=delete
 Not movable.
 
 manual_reset_event (manual_reset_event const &)=delete
 Not copyable.
 
 ~manual_reset_event ()
 Destroy the event; destroy the semaphore if it is initialized.
 
auto operator= (manual_reset_event &&) -> manual_reset_event &=delete
 Not movable.
 
auto operator= (manual_reset_event const &) -> manual_reset_event &=delete
 Not copyable.
 
void reset ()
 Reset the event to an unsignalled state.
 
void signal ()
 Signal the event and wake any blocked waiters.
 
void wait () const
 Wait for the event to be signalled. Return immediately if it is already signalled.
 

Detailed Description

An event class that allows blocking waits from an arbitrary number of threads that are then woken when the event is signalled. Additional calls to wait while the event is signalled will return immediately. If there are no waiting threads, the event can be reset to an unsignalled state.

Constructor & Destructor Documentation

◆ manual_reset_event() [1/3]

arene::base::manual_reset_event::manual_reset_event ( )
constexprdefaultnoexcept

Initialize the event to an unsignalled state.

◆ ~manual_reset_event()

arene::base::manual_reset_event::~manual_reset_event ( )
inline

Destroy the event; destroy the semaphore if it is initialized.

◆ manual_reset_event() [2/3]

arene::base::manual_reset_event::manual_reset_event ( manual_reset_event const & )
delete

Not copyable.

◆ manual_reset_event() [3/3]

arene::base::manual_reset_event::manual_reset_event ( manual_reset_event && )
delete

Not movable.

Member Function Documentation

◆ operator=() [1/2]

auto arene::base::manual_reset_event::operator= ( manual_reset_event && ) -> manual_reset_event &=delete
delete

Not movable.

◆ operator=() [2/2]

auto arene::base::manual_reset_event::operator= ( manual_reset_event const & ) -> manual_reset_event &=delete
delete

Not copyable.

◆ reset()

void arene::base::manual_reset_event::reset ( )
inline

Reset the event to an unsignalled state.

Precondition
There must be no threads blocked in wait.
Exceptions
std::system_erroron error.

◆ signal()

void arene::base::manual_reset_event::signal ( )
inline

Signal the event and wake any blocked waiters.

Exceptions
std::system_erroron error.

◆ wait()

void arene::base::manual_reset_event::wait ( ) const
inline

Wait for the event to be signalled. Return immediately if it is already signalled.

Exceptions
std::system_erroron error.
std::system_errorif an error occurs in the underlying OS facilities

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