HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulebase-4.20.2.0Haskell2010

Control.Concurrent.QSemN

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

  • 1 type
  • 3 values
  • Packagebase-4.20.2.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.