Copyright | (c) 2016 Michael Walker |
---|---|
License | MIT |
Maintainer | Michael Walker <mike@barrucadu.co.uk> |
Stability | stable |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Simple quantity semaphores.
Simple Quantity Semaphores
QSem
is a quantity semaphore in which the resource is acquired
and released in units of one. It provides guaranteed FIFO ordering
for satisfying blocked waitQSem
calls.
The pattern
bracket_ qaitQSem signalSSem (...)
is safe; it never loses a unit of the resource.
Since: 1.0.0.0
newQSem :: (MonadConc m, MonadFail m) => Int -> m (QSem m) Source #
Build a new QSem
with a supplied initial quantity. The initial
quantity must be at least 0.
Since: 1.0.0.0