stm-2.4.2: Software Transactional Memory

Portabilitynon-portable (requires STM)
Stabilityexperimental
Maintainerlibraries@haskell.org
Safe HaskellTrustworthy

Control.Concurrent.STM.TVar

Contents

Description

TVar: Transactional variables

Synopsis

TVars

data TVar a

Instances

Typeable1 TVar 
Eq (TVar a) 

newTVar :: a -> STM (TVar a)

newTVarIO :: a -> IO (TVar a)

readTVar :: TVar a -> STM a

readTVarIO :: TVar a -> IO a

writeTVar :: TVar a -> a -> STM ()

modifyTVar :: TVar a -> (a -> a) -> STM ()Source

Mutate the contents of a TVar. N.B., this version is non-strict.

modifyTVar' :: TVar a -> (a -> a) -> STM ()Source

Strict version of modifyTVar.

swapTVar :: TVar a -> a -> STM aSource

Swap the contents of a TVar for a new value.

registerDelay :: Int -> IO (TVar Bool)