Safe Haskell | None |
---|---|
Language | GHC2021 |
Polysemy.Conc.Effect.Lock
Description
Lock effect, Internal
Synopsis
- data Lock (a :: Type -> Type) b where
- lock :: forall (r :: EffectRow) a. Member Lock r => Sem r a -> Sem r a
- lockOr :: forall (r :: EffectRow) a. Member Lock r => Sem r a -> Sem r a -> Sem r a
- lockOrSkip :: forall (r :: EffectRow) a. Member Lock r => Sem r a -> Sem r (Maybe a)
- lockOrSkip_ :: forall (r :: EffectRow) a. Member Lock r => Sem r a -> Sem r ()
Documentation
data Lock (a :: Type -> Type) b where Source #
An exclusive lock or mutex, protecting a region from concurrent access.
lock :: forall (r :: EffectRow) a. Member Lock r => Sem r a -> Sem r a Source #
Run an action if the lock is available, block otherwise.
lockOr :: forall (r :: EffectRow) a. Member Lock r => Sem r a -> Sem r a -> Sem r a Source #
Run the second action if the lock is available, or the first action otherwise.