Event

Class implementing event objects.

An event manages a flag that can be set to true with the $(D_PSYMBOL set()) method and reset to false with the $(D_PSYMBOL clear()) method. The $(D_PSYMBOL wait()) method blocks until the flag is true. The flag is initially false.

This class is not thread safe.

Members

Functions

clear
void clear()

Reset the internal flag to false. Subsequently, coroutines calling $(D_PSYMBOL wait()) will block until $(D_PSYMBOL set()) is called to set the internal flag to true again.

isSet
bool isSet()

Return $(D_KEYWORD true) if and only if the internal flag is true.

set
void set()

Set the internal flag to true. All coroutines waiting for it to become true are awakened. Coroutines that call $(D_PSYMBOL wait()) once the flag is true will not block at all.

wait
bool wait()

Block until the internal flag is true.

Meta