fay-base-0.21.2.0: The base package for Fay.
Safe HaskellNone
LanguageHaskell2010

Data.Mutex

Description

A trivial mutex.

Synopsis

Documentation

data Mutex Source #

Constructors

Mutex (Var Bool) 

newMutex :: Fay Mutex Source #

Make a new unlocked mutex.

ifMutexFree :: Mutex -> Fay () -> Fay () Source #

If a mutex is free run the action, otherwise don't.

whenMutexFree :: Mutex -> Fay () -> Fay () Source #

Wait until the mutex is free to do something.

lockMutex :: Mutex -> (Fay () -> Fay a) -> Fay a Source #

Lock the given mutex until I'm done with it.