polysemy-conc-0.14.1.1: Polysemy effects for concurrency
Safe HaskellNone
LanguageGHC2021

Polysemy.Conc.Interpreter.Lock

Description

Lock interpreters, Internal

Synopsis

Documentation

interpretLockPermissive :: forall (r :: [Effect]) a. Sem (Lock ': r) a -> Sem r a Source #

Interpret Lock by executing all actions unconditionally.

interpretLockReentrantEntered :: forall (r :: EffectRow). Members '[Sync (), Resource, Race, Mask, Embed IO] r => ThreadId -> InterpreterFor Lock r Source #

Subinterpreter for interpretLockReentrant that checks whether the current thread is equal to the lock-acquiring thread to allow reentry into the lock.

interpretLockReentrant :: forall (r :: EffectRow). Members '[Resource, Race, Mask, Embed IO] r => InterpreterFor Lock r Source #

Interpret Lock as a reentrant lock, allowing nested calls to lock unless called from a different thread (as in, async was called in a higher-order action passed to lock.)