Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
:: 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 #
Instances
Eq SemaphoreName | |
Defined in System.Semaphore (==) :: SemaphoreName -> SemaphoreName -> Bool # (/=) :: SemaphoreName -> SemaphoreName -> Bool # |
Abstract semaphores
data AbstractSem #
Abstraction over the operations of a semaphore.
AbstractSem | |
|
withAbstractSem :: AbstractSem -> IO b -> IO b #