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.
Modulerebase-1.21.2Haskell2010
Rebase.Control.Concurrent.STM.TMVar
- 1 type
- 14 values
- Packagerebase-1.21.2
- Exports15
- LanguageHaskell2010
- LicenceMIT
- SourceTMVar.hs
Check whether a given TMVar is empty.
Create a TMVar which is initially empty.
IO version of newEmptyTMVar. This is useful for creating top-level
TMVars using unsafePerformIO, because using
atomically inside unsafePerformIO isn't
possible.
Create a TMVar which contains the supplied value.
IO version of newTMVar. This is useful for creating top-level
TMVars using unsafePerformIO, because using
atomically inside unsafePerformIO isn't
possible.
Swap the contents of a TMVar for a new value.
A version of readTMVar which does not retry. Instead it
returns Nothing if no value is available.
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.
Non-blocking write of a new value to a TMVar Puts if empty. Replaces if populated.