HORIZON HASKELLDocslts/ghc-10.0.xaa25b892026-10-10Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10

Moduleunix-2.8.8.0Haskell2010

System.Posix.Semaphore

POSIX named semaphore support.

  • 2 types
  • 8 values
  • Packageunix-2.8.8.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.