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

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

Modulebase-4.23.0.0Haskell2010

Control.Concurrent.QSemN

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

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