|Maintainer||Bas van Dijk <firstname.lastname@example.org> , Roel van Dijk <email@example.com>|
An Event is a simple mechanism for communication between threads: one thread signals an event and other threads wait for it.
Each event has an internal state which is either "Set" or "Cleared". This
state can be changed with the corresponding functions
wait function blocks until the state is "Set". An important property of
setting an event is that all threads waiting for it are woken.
It was inspired by the Python
Event object. See:
This module is designed to be imported qualified. We suggest importing it like:
import Control.Concurrent.STM.Event ( Event ) import qualified Control.Concurrent.STM.Event as Event ( ... )
An event is in one of two possible states: "Set" or "Cleared".
Changes the state of the event to "Set". All threads that where waiting for
this event are woken. Threads that
wait after the state is changed to "Set"
will not retry.
Changes the state of the event to "Cleared". Threads that
wait after the
state is changed to "Cleared" will retry until the state is changed to "Set".