tmc::auto_reset_event#

An async version of Windows AutoResetEvent.

API Reference#

class auto_reset_event : protected tmc::detail::waiter_data_base#

An async version of Windows AutoResetEvent.

Public Functions

inline auto_reset_event(bool Ready) noexcept#

The Ready parameter controls the initial state.

inline auto_reset_event() noexcept#

The initial state will be not-set / not-ready.

inline bool is_set() noexcept#

Returns true if the state is set / ready.

void reset() noexcept#

Any future awaiters will suspend. If the event state is already reset, this will do nothing.

void set() noexcept#

Makes the event state set. If there are any awaiters, the state will be immediately reset and one awaiter will be resumed. If the event state is already set, this will do nothing. Does not symmetric transfer; awaiters will be posted to their executors.

inline aw_auto_reset_event_co_set co_set() noexcept#

Makes the event state set. If there are any awaiters, the state will be immediately reset and one awaiter will be resumed. If the event state is already set, this will do nothing. The awaiter may be resumed by symmetric transfer if it is eligible (it resumes on the same executor and priority as the caller).

inline aw_acquire operator co_await() noexcept#

If the event state is set, resumes immediately. Otherwise, waits until set() is called.

~auto_reset_event()#

On destruction, any awaiters will be resumed.