HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulebase-4.20.2.0Haskell2010

Control.Concurrent.QSem

Simple quantity semaphores.

  • 1 type
  • 3 values
  • Packagebase-4.20.2.0
  • Exports4
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceQSem.hs

Simple Quantity Semaphores

4 declarations
newtypenewtype QSem
#

QSem is a quantity semaphore in which the resource is acquired and released in units of one. It provides guaranteed FIFO ordering for satisfying blocked waitQSem calls.

The pattern

bracket_ waitQSem signalQSem (...)

is safe; it never loses a unit of the resource.

valuenewQSem :: Int -> IO QSem
#

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