Shared memory locations that support atomic memory transactions.
Modulestm-2.5.3.1Haskell2010
Control.Concurrent.STM.TVar
- 1 type
- 11 values
- Packagestm-2.5.3.1
- Exports12
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceSync.hs
TVars
12 declarationsCreate a new TVar holding a value supplied
IO version of newTVar. This is useful for creating top-level
TVars using unsafePerformIO, because using
atomically inside unsafePerformIO isn't
possible.
Return the current value stored in a TVar.
Write the supplied value into a TVar.
Mutate the contents of a TVar. N.B., this version is non-strict.
Strict version of modifyTVar.
Like modifyTVar' but the function is a simple state transition that can return a side value which is passed on as the result of the STM.
Swap the contents of a TVar for a new value.
Switch the value of returned TVar from initial value False to True after a given number of microseconds. The caveats associated with threadDelay also apply.
Be careful not to exceed maxBound :: Int, which on 32-bit machines is only
2147483647 μs, less than 36 minutes.