HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleunix-2.8.7.0Haskell2010

System.Posix.Semaphore

POSIX named semaphore support.

  • 2 types
  • 8 values
  • Packageunix-2.8.7.0
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceSemaphore.hsc
valuesemWait :: Semaphore -> IO ()
#

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.

valuesemTryWait :: Semaphore -> IO Bool
#

Attempt to lock the semaphore without blocking. Immediately return False if it is not available.

valuesemThreadWait :: Semaphore -> IO ()
#

Poll the semaphore until it is available, then lock it. Unlike semWait, this will block only the current thread rather than the entire process.