Safe Haskell | Unsafe |
---|
This module implements the core of labeled MVars
s in the 'LIO ad.
to Control.Concurrent.MVar, but the operations take place in the
LIO
monad. The types and functions exported by this module are
strictly TCB and do not perform any information flow checks. The
external, safe interface is provided and documented in
LIO.Concurrent.LMVar.
- data LMVar l a = LMVarTCB {
- labelOfLMVar :: !l
- unlabelLMVarTCB :: MVar a
- newEmptyLMVarTCB :: MonadLIO l m => l -> m (LMVar l a)
- newLMVarTCB :: MonadLIO l m => l -> a -> m (LMVar l a)
- takeLMVarTCB :: MonadLIO l m => LMVar l a -> m a
- tryTakeLMVarTCB :: MonadLIO l m => LMVar l a -> m (Maybe a)
- putLMVarTCB :: MonadLIO l m => LMVar l a -> a -> m ()
- tryPutLMVarTCB :: MonadLIO l m => LMVar l a -> a -> m Bool
- readLMVarTCB :: MonadLIO l m => LMVar l a -> m a
- swapLMVarTCB :: MonadLIO l m => LMVar l a -> a -> m a
- isEmptyLMVarTCB :: MonadLIO l m => LMVar l a -> m Bool
Documentation
An LMVar
is a labeled synchronization variable (an MVar
) that
can be used by concurrent threads to communicate.
LMVarTCB | |
|
Creating labeled MVar
s
newEmptyLMVarTCB :: MonadLIO l m => l -> m (LMVar l a)Source
Trusted function used to create an empty LMVar
, ignoring IFC.
newLMVarTCB :: MonadLIO l m => l -> a -> m (LMVar l a)Source
Trusted function used to create an LMVar
with the supplied
value, ignoring IFC.
Take LMVar
takeLMVarTCB :: MonadLIO l m => LMVar l a -> m aSource
Read the contents of an LMVar
, ignoring IFC.
tryTakeLMVarTCB :: MonadLIO l m => LMVar l a -> m (Maybe a)Source
Same as tryTakeLMVar
, but ignorses IFC.
Put LMVar
tryPutLMVarTCB :: MonadLIO l m => LMVar l a -> a -> m BoolSource
Same as tryPutLMVar
, but ignorses IFC.
Read LMVar
readLMVarTCB :: MonadLIO l m => LMVar l a -> m aSource
Trusted function used to read (take and put) an LMVar
, ignoring IFC.
Swap LMVar
swapLMVarTCB :: MonadLIO l m => LMVar l a -> a -> m aSource
Trusted function that swaps value of LMVar
, ignoring IFC.
Check state of LMVar
isEmptyLMVarTCB :: MonadLIO l m => LMVar l a -> m BoolSource
Same as isEmptyLMVar
, but ignorses IFC.