An Event is a simple mechanism for communication between threads: one thread
signals an event and other threads wait for it.

An event has a state which is either "set" or "cleared". This state can
be changed with the corresponding functions set and clear. The wait
function blocks until the state is "set". An important property of setting
an event is that all threads waiting for it are woken.