lifted-base-0.2.3.12: 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.QSemN.Lifted

Description

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

Synopsis

Documentation

data QSemN :: * #

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

The pattern

  bracket_ (waitQSemN n) (signalQSemN n) (...)

is safe; it never loses any of the resource.

newQSemN :: MonadBase IO m => Int -> m QSemN Source #

Generalized version of newQSemN.

waitQSemN :: MonadBase IO m => QSemN -> Int -> m () Source #

Generalized version of waitQSemN.

signalQSemN :: MonadBase IO m => QSemN -> Int -> m () Source #

Generalized version of signalQSemN.