Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Bounded quantity semaphores.
Documentation
Bounded quantity semaphore in which the resource is acquired and released in units of one, but with a maximum amount of units available at any given time.
Build a new BQSem
with supplied initial and maximum supply.
An exception is thrown in any of the following cases:
- Initial supply is negative.
- Maximum supply is less than 1.
- Initial supply exceeds maximum.
signalBQSem :: BQSem -> IO () Source #
Make a new unit available, unless the maximum number of units has been reached, in which case it does nothing (it doesn't block).