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.
Modulestm-2.5.3.1Haskell2010
Control.Concurrent.STM.TMVar
- 1 type
- 14 values
- Packagestm-2.5.3.1
- Exports15
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceTMVar.hs
TMVars
15 declarationsCreate a TMVar which contains the supplied value.
Create a TMVar which is initially empty.
IO version of newTMVar. This is useful for creating top-level
TMVars using unsafePerformIO, because using
atomically inside unsafePerformIO isn't
possible.
IO version of newEmptyTMVar. This is useful for creating top-level
TMVars using unsafePerformIO, because using
atomically inside unsafePerformIO isn't
possible.
Non-blocking write of a new value to a TMVar Puts if empty. Replaces if populated.
A version of readTMVar which does not retry. Instead it
returns Nothing if no value is available.
Swap the contents of a TMVar for a new value.
A version of takeTMVar that does not retry. The tryTakeTMVar
function returns Nothing if the TMVar was empty, or Just a if
the TMVar was full with contents a. After tryTakeTMVar, the
TMVar is left empty.
Check whether a given TMVar is empty.