semaphore-compat

Cross-platform abstraction for system semaphores

https://gitlab.haskell.org/ghc/semaphore-compat

Version on this page:1.0.0
Stackage Nightly 2024-10-31:1.0.0
Latest on Hackage:1.0.0@rev:3

See all snapshots semaphore-compat appears in

BSD-3-Clause licensed by The GHC team
Maintained by [email protected]
This version can be pinned in stack with:semaphore-compat-1.0.0@sha256:868694b09361e7c6756542bcdcfba68a9b8b93410c6798709e475abd3751afe7,1161

Module documentation for 1.0.0

Depends on 3 packages(full list with versions):
Used by 2 packages in nightly-2024-02-08(full list with versions):

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 and interruptWaitOnSemaphore.
  • Releasing tokens to a semaphore (releaseSemaphore).
  • Querying the semaphore for its current value (getSemaphoreValue).

Changes

1.0.0 (March 13, 2023)

  • First version of the semaphore-compat package.