Constructors
OpenSemFlagssemCreate :: BoolIf true, create the semaphore if it does not yet exist.
semExclusive :: BoolIf true, throw an exception if the semaphore already exists.
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27
Moduleunix-2.8.7.0Haskell2010
POSIX named semaphore support.
OpenSemFlagssemCreate :: BoolIf true, create the semaphore if it does not yet exist.
semExclusive :: BoolIf true, throw an exception if the semaphore already exists.
Open a named semaphore with the given name, flags, mode, and initial value.
Delete the semaphore with the given name.
Lock the semaphore, blocking until it becomes available. Since this is done through a system call, this will block the *entire runtime*, not just the current thread. If this is not the behaviour you want, use semThreadWait instead.
Attempt to lock the semaphore without blocking. Immediately return False if it is not available.
Poll the semaphore until it is available, then lock it. Unlike semWait, this will block only the current thread rather than the entire process.
Unlock the semaphore.
Return the semaphore's current value.