Copyright | (c) Peter Robinson 2009 |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Peter Robinson <robinson@ecs.tuwien.ac.at> |
Stability | experimental |
Portability | non-portable (requires STM) |
Safe Haskell | Safe |
Language | Haskell2010 |
Synopsis
- data TVar a
- newTVar :: MonadAdvSTM m => a -> m (TVar a)
- newTVarIO :: a -> IO (TVar a)
- readTVar :: MonadAdvSTM m => TVar a -> m a
- writeTVar :: MonadAdvSTM m => TVar a -> a -> m ()
- readTVarAsync :: MonadAdvSTM m => TVar a -> m a
- writeTVarAsync :: MonadAdvSTM m => TVar a -> a -> m ()
TVars
readTVar :: MonadAdvSTM m => TVar a -> m a Source #
Reads a value from a TVar. Blocks until the IO onCommit aidction(s) of
the corresponding transaction are complete.is not the last function
See onCommit
for a more detailed description of this behaviour.
writeTVar :: MonadAdvSTM m => TVar a -> a -> m () Source #
Writes a value to a TVar. Blocks until the onCommit IO-action(s) are
complete. See onCommit
for details.
readTVarAsync :: MonadAdvSTM m => TVar a -> m a Source #
Reads a value directly from the TVar. Does not block when the onCommit actions aren't done yet. NOTE: Only use this function when you know what you're doing.
writeTVarAsync :: MonadAdvSTM m => TVar a -> a -> m () Source #
Writes a value directly to the TVar. Does not block when onCommit actions aren't done yet. This function comes in handy for error recovery of exceptions that occur in onCommit.