Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
GHC.Driver.MakeSem
Description
Implementation of a jobserver using system semaphores.
Synopsis
- runJSemAbstractSem :: SemaphoreName -> (AbstractSem -> IO a) -> IO a
- data Semaphore
- newtype SemaphoreName = SemaphoreName {}
- data AbstractSem = AbstractSem {
- acquireSem :: IO ()
- releaseSem :: IO ()
- withAbstractSem :: AbstractSem -> IO b -> IO b
JSem: parallelism semaphore backed
Arguments
:: SemaphoreName | the system semaphore to use |
-> (AbstractSem -> IO a) | the operation to run which requires a semaphore |
-> IO a |
Implement an abstract semaphore using a semaphore Jobserver
which queries the system semaphore of the given name for resources.
System semaphores
newtype SemaphoreName #
Constructors
SemaphoreName | |
Fields |
Instances
Eq SemaphoreName | |
Defined in System.Semaphore Methods (==) :: SemaphoreName -> SemaphoreName -> Bool # (/=) :: SemaphoreName -> SemaphoreName -> Bool # |
Abstract semaphores
data AbstractSem #
Abstraction over the operations of a semaphore.
Constructors
AbstractSem | |
Fields
|
withAbstractSem :: AbstractSem -> IO b -> IO b #