shared-buffer-0.1.0.6: A circular buffer built on shared memory

Safe HaskellNone
LanguageHaskell98

System.Posix.Semaphore.Unsafe

Synopsis

Documentation

unsafeSemTryWait :: Semaphore -> IO Bool Source

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

unsafeSemPost :: Semaphore -> IO () Source

Unlock the semaphore.

unsafeSemGetValue :: Semaphore -> IO Int Source

Return the semaphore's current value.

unsafeSemLock :: Semaphore -> IO () Source

Attempt to lock the semaphore without blocking, and call error if the semaphore is unavailable.

This function should only be called when you want to lock the semaphore, and can guarantee that doing so will not block.

semTimedWait :: Int -> Int -> Semaphore -> IO Bool Source

Wait on a semaphore with a timeout value. Returns True if a lock was acquired, False if it timed out before acquiring a lock.

if interrupted by a signal, semTimedWait will retry. An exception will be raised if sem_timedwait() fails for any other reason.