HORIZON HASKELLDocslts/ghc-10.0.xc62e4de2026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · c62e4de · 2026-10-19

Moduleconcurrency-1.11.0.3Haskell2010

Control.Concurrent.Classy.QSemN

Quantity semaphores in which each thread may wait for an arbitrary "amount".

  • 1 type
  • 3 values

General Quantity Semaphores

4 declarations
newtypenewtype QSemN (m :: Type -> Type)
#

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.