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

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

Moduleghc-10.0.0.20260917GHC2024

GHC.Driver.MakeSem

Implementation of a jobserver using system semaphores.

  • 1 type
  • 2 values

JSem: parallelism semaphore backed

1 declaration
valuerunJSemAbstractSem
  1. :: SemaphoreIdentifier

    the semaphore identifier (from -jsem)

  2. -> (AbstractSem -> IO a)

    the operation to run which requires a semaphore

  3. -> IO a
#

Implement an abstract semaphore using a semaphore Jobserver which queries the system semaphore of the given name for resources.

Abstract semaphores

2 declarations
valuewithAbstractSem :: AbstractSem -> IO b -> IO b
#

Acquire/release bracket pattern: acquire a token, perform an action, and release the token.

Guarantees that the token is released in case that the inner action throws an exception.