@hackage semaphore-compat1.0.0
Cross-platform abstraction for system semaphores
Categories
License
BSD-3-Clause
Maintainer
ghc-devs@haskell.org
Links
Versions
- 1.0.0 Sun, 2 Jun 2024
Installation
Dependencies (4)
- Win32 >=2.13.4.0 && <2.15
- base >=4.11 && <4.22
- unix >=2.8.1.0 && <2.9
- exceptions >=0.7 && <0.11 Show all…
Dependents (4)
@hackage/ghc-lib, @hackage/ghc, @hackage/build-env, @hackage/cabal-install
semaphore-compat
semaphore-compat
provides a cross-platform implementation of system semaphores
that abstracts over the unix
and Win32
libraries.
It supports:
- Creating (
createSemaphore
,freshSemaphore
), opening (openSemaphore
) and closing (destroySemaphore
) semaphores. - Waiting on a semaphore:
- without blocking with
tryWaitOnSemaphore
, - blocking forever, with
waitOnSemaphore
, - blocking, in a separate thread and allowing interruption, with
forkWaitOnSemaphoreInterruptible
andinterruptWaitOnSemaphore
.
- without blocking with
- Releasing tokens to a semaphore (
releaseSemaphore
). - Querying the semaphore for its current value (
getSemaphoreValue
).