|Portability||non-portable (requires Futures)|
This module implements a quantity semaphore using handles that block on
A HQSem equals to QSemN in Control.Concurrent.
A Buffer euqals to QSem in Control.Concurrent.
Warning: All operations on quantity semaphores should only be used within the
global wrapper function
A handled quantity semaphores contains of a capacity and a waiting queue containing handles.
Increments the semaphore's value, if there are no waiters.
up reads out of the waiting queue and binds a waiting handle to True.
Note: This operation equals to signalQSemN in Control.Concurrent.QSemN.
Decrements the semaphore's value. If the value has already reached 0, then
down creates a new handle that is being added to the semaphore's waiting queue.
It blocks until the handle assigns a value to its future by a
Note: This operation equals to waitQSemN in Control.Concurrent.QSemN.