Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Lock effect, Internal
Documentation
data Lock :: Effect where Source #
An exclusive lock or mutex, protecting a region from concurrent access.
Lock :: m a -> Lock m a | Run an action if the lock is available, block otherwise. |
LockOr :: m a -> m a -> Lock m a | Run the second action if the lock is available, or the first action otherwise. |
Instances
type DefiningModule Lock Source # | |
Defined in Polysemy.Conc.Effect.Lock |
lock :: forall r a. Member Lock r => Sem r a -> Sem r a Source #
Run an action if the lock is available, block otherwise.
lockOr :: forall r a. Member Lock r => Sem r a -> Sem r a -> Sem r a Source #
Run an action if the lock is available, block otherwise.