HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Moduleghc-10.0.0.20260917GHC2024

GHC.Driver.MakeSem

Implementation of a jobserver using system semaphores.

Contents
  1. JSem: parallelism semaphore backed
  2. Abstract semaphores
Synopsis

JSem: parallelism semaphore backed

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

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.