TMVar: Transactional MVars, for use in the STM monad (GHC only)
expiring-mvar provides the type ExpiringMVar. ExpiringMVar is a container for a single value. When creating an ExpiringMVar, a thread is spawned which deletes the value held in the ExpiringMVar after a given period of time. The timer can be reset, cancelled, or restarted with a new time amount.
Check whether a given TMVar is empty.
Create a TMVar which is initially empty.
Create a TMVar which contains the supplied value.
This is a combination of takeTMVar and putTMVar; ie. it takes the value from the TMVar, puts it back, and also returns it.
Swap the contents of a TMVar for a new value.
A TMVar is a synchronising variable, used for communication between concurrent threads. It can be thought of as a box, which may be empty or full.
A version of readTMVar which does not retry. Instead it returns Nothing if no value is available.