stm-2.1.1.2: Software Transactional MemorySource codeContentsIndex
Control.Concurrent.STM.TVar
Portabilitynon-portable (requires STM)
Stabilityexperimental
Maintainerlibraries@haskell.org
Contents
TVars
Description
TVar: Transactional variables
Synopsis
data TVar a
newTVar :: a -> STM (TVar a)
readTVar :: TVar a -> STM a
writeTVar :: TVar a -> a -> STM ()
newTVarIO :: a -> IO (TVar a)
registerDelay :: Int -> IO (TVar Bool)
TVars
data TVar a Source
Shared memory locations that support atomic memory transactions.
newTVar :: a -> STM (TVar a)Source
Create a new TVar holding a value supplied
readTVar :: TVar a -> STM aSource
Return the current value stored in a TVar
writeTVar :: TVar a -> a -> STM ()Source
Write the supplied value into a TVar
newTVarIO :: a -> IO (TVar a)Source
IO version of newTVar. This is useful for creating top-level TVars using System.IO.Unsafe.unsafePerformIO, because using atomically inside System.IO.Unsafe.unsafePerformIO isn't possible.
registerDelay :: Int -> IO (TVar Bool)Source
Set the value of returned TVar to True after a given number of microseconds. The caveats associated with threadDelay also apply.
Produced by Haddock version 2.6.0