Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- mkWeakTMVar :: TMVar a -> IO () -> IO (Weak (TMVar a))
- isEmptyTMVar :: TMVar a -> STM Bool
- swapTMVar :: TMVar a -> a -> STM a
- tryReadTMVar :: TMVar a -> STM (Maybe a)
- readTMVar :: TMVar a -> STM a
- tryPutTMVar :: TMVar a -> a -> STM Bool
- putTMVar :: TMVar a -> a -> STM ()
- tryTakeTMVar :: TMVar a -> STM (Maybe a)
- takeTMVar :: TMVar a -> STM a
- newEmptyTMVar :: STM (TMVar a)
- newTMVar :: a -> STM (TMVar a)
- data TMVar a
- newTMVarIO :: MonadIO m => a -> m (TMVar a)
- newEmptyTMVarIO :: MonadIO m => m (TMVar a)
- takeTMVarIO :: MonadIO m => TMVar a -> m a
- putTMVarIO :: MonadIO m => TMVar a -> a -> m ()
- readTMVarIO :: MonadIO m => TMVar a -> m a
- tryReadTMVarIO :: MonadIO m => TMVar a -> m (Maybe a)
- swapTMVarIO :: MonadIO m => TMVar a -> a -> m a
- tryTakeTMVarIO :: MonadIO m => TMVar a -> m (Maybe a)
- tryPutTMVarIO :: MonadIO m => TMVar a -> a -> m Bool
- isEmptyTMVarIO :: MonadIO m => TMVar a -> m Bool
Documentation
tryReadTMVar :: TMVar a -> STM (Maybe a) #
A version of readTMVar
which does not retry. Instead it
returns Nothing
if no value is available.
Since: stm-2.3
tryPutTMVar :: TMVar a -> a -> STM Bool #
tryTakeTMVar :: TMVar a -> STM (Maybe a) #
A version of takeTMVar
that does not retry
. The tryTakeTMVar
function returns Nothing
if the TMVar
was empty, or
if
the Just
aTMVar
was full with contents a
. After tryTakeTMVar
, the
TMVar
is left empty.
newEmptyTMVar :: STM (TMVar a) #
Create a TMVar
which is initially empty.
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.
newTMVarIO :: MonadIO m => a -> m (TMVar a) Source #
newEmptyTMVarIO :: MonadIO m => m (TMVar a) Source #
takeTMVarIO :: MonadIO m => TMVar a -> m a Source #
putTMVarIO :: MonadIO m => TMVar a -> a -> m () Source #
readTMVarIO :: MonadIO m => TMVar a -> m a Source #
swapTMVarIO :: MonadIO m => TMVar a -> a -> m a Source #