lifted-base-0.2.3.11: lifted IO operations from the base library

CopyrightLiyang HU Bas van Dijk
LicenseBSD-style
MaintainerBas van Dijk <v.dijk.bas@gmail.com>
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell98

Control.Concurrent.QSem.Lifted

Description

This is a wrapped version of Control.Concurrent.QSem with types generalised from IO to all monads in MonadBase.

Synopsis

Documentation

data QSem :: * #

QSem is a quantity semaphore in which the resource is aqcuired and released in units of one. It provides guaranteed FIFO ordering for satisfying blocked waitQSem calls.

The pattern

  bracket_ waitQSem signalQSem (...)

is safe; it never loses a unit of the resource.

newQSem :: MonadBase IO m => Int -> m QSem Source #

Generalized version of newQSem.

waitQSem :: MonadBase IO m => QSem -> m () Source #

Generalized version of waitQSem.

signalQSem :: MonadBase IO m => QSem -> m () Source #

Generalized version of signalQSem.