Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Unlifted Control.Concurrent.MVar .
Since: 0.1.0.0
Synopsis
- data MVar a
- newEmptyMVar :: MonadIO m => m ( MVar a)
- newMVar :: MonadIO m => a -> m ( MVar a)
- takeMVar :: MonadIO m => MVar a -> m a
- putMVar :: MonadIO m => MVar a -> a -> m ()
- readMVar :: MonadIO m => MVar a -> m a
- swapMVar :: MonadIO m => MVar a -> a -> m a
- tryTakeMVar :: MonadIO m => MVar a -> m ( Maybe a)
- tryPutMVar :: MonadIO m => MVar a -> a -> m Bool
- isEmptyMVar :: MonadIO m => MVar a -> m Bool
- withMVar :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b
- withMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b
- modifyMVar :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b
- modifyMVar_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m ()
- modifyMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b
- modifyMVarMasked_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m ()
- tryReadMVar :: MonadIO m => MVar a -> m ( Maybe a)
- mkWeakMVar :: MonadUnliftIO m => MVar a -> m () -> m ( Weak ( MVar a))
Documentation
An
MVar
(pronounced "em-var") is a synchronising variable, used
for communication between concurrent threads. It can be thought of
as a box, which may be empty or full.
Instances
NFData1 MVar |
Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq |
|
Eq ( MVar a) |
Since: base-4.1.0.0 |
NFData ( MVar a) |
NOTE : Only strict in the reference and not the referenced value. Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq |
newEmptyMVar :: MonadIO m => m ( MVar a) Source #
Lifted
newEmptyMVar
.
Since: 0.1.0.0
tryTakeMVar :: MonadIO m => MVar a -> m ( Maybe a) Source #
Lifted
tryTakeMVar
.
Since: 0.1.0.0
tryPutMVar :: MonadIO m => MVar a -> a -> m Bool Source #
Lifted
tryPutMVar
.
Since: 0.1.0.0
isEmptyMVar :: MonadIO m => MVar a -> m Bool Source #
Lifted
isEmptyMVar
.
Since: 0.1.0.0
withMVar :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b Source #
Unlifted
withMVar
.
Since: 0.1.0.0
withMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b Source #
Unlifted
withMVarMasked
.
Since: 0.1.0.0
modifyMVar :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b Source #
Unlifted
modifyMVar
.
Since: 0.1.0.0
modifyMVar_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m () Source #
Unlifted
modifyMVar_
.
Since: 0.1.0.0
modifyMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b Source #
Unlifted
modifyMVarMasked
.
Since: 0.1.0.0
modifyMVarMasked_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m () Source #
Unlifted
modifyMVarMasked_
.
Since: 0.1.0.0
tryReadMVar :: MonadIO m => MVar a -> m ( Maybe a) Source #
Lifted
tryReadMVar
.
Since: 0.1.0.0
mkWeakMVar :: MonadUnliftIO m => MVar a -> m () -> m ( Weak ( MVar a)) Source #
Unlifted
mkWeakMVar
.
Since: 0.1.0.0