|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
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.Event ( Event ) import qualified Control.Concurrent.Event as Event ( ... )
Block until the event is
set or until a timer expires.
The timeout is specified in microseconds. A timeout of 0 μs will cause
the function to return
False without blocking in case the event state is
Cleared. Negative timeouts are treated the same as a timeout of 0
μs. The maximum timeout is constrained by the range of the
type. The Haskell standard guarantees an upper bound of at least
giving a maximum timeout of at least
(2^29-1) / 10^6 = ~536 seconds.