Copyright | © 2021 IOHK |
---|---|
License | Apache-2.0 |
Safe Haskell | None |
Language | Haskell2010 |
This module provides a utility for ordering concurrent actions via locks.
Synopsis
- data Concierge m lock
- newConcierge :: MonadSTM m => m ( Concierge m lock)
- atomicallyWith :: ( Ord lock, MonadIO m, MonadThrow m) => Concierge IO lock -> lock -> m a -> m a
- atomicallyWithLifted :: ( Ord lock, MonadSTM m, MonadThread m, MonadThrow n) => ( forall b. m b -> n b) -> Concierge m lock -> lock -> n a -> n a
Documentation
newConcierge :: MonadSTM m => m ( Concierge m lock) Source #
Create a new
Concierge
that keeps track of locks.
atomicallyWith :: ( Ord lock, MonadIO m, MonadThrow m) => Concierge IO lock -> lock -> m a -> m a Source #
atomicallyWithLifted :: ( Ord lock, MonadSTM m, MonadThread m, MonadThrow n) => ( forall b. m b -> n b) -> Concierge m lock -> lock -> n a -> n a Source #
More polymorphic version of
atomicallyWith
.