HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Modulebase-4.22.0.0Haskell2010

Control.Concurrent.QSemN

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

  • 1 type
  • 3 values
  • Packagebase-4.22.0.0
  • Exports4
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceQSemN.hs

General Quantity Semaphores

4 declarations
datadata QSemN
#

QSemN is a quantity semaphore in which the resource is acquired and released in arbitrary amounts. 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.

valuenewQSemN :: Int -> IO QSemN
#

Build a new QSemN with a supplied initial quantity. The initial quantity must be at least 0.