haskus-system-0.7.0.0: Haskus system programming framework

Safe HaskellNone
LanguageHaskell2010

Haskus.System.Linux.Futex

Description

Futex (user-space mutex)

Synopsis

Documentation

sysFutex :: MonadIO m => Ptr Int64 -> FutexOp -> Int64 -> Ptr TimeSpec -> Ptr Int64 -> Int64 -> Flow m '[Int64, ErrorCode] Source #

All the Futex API uses this futex syscall

futexWait :: MonadInIO m => Ptr Int64 -> Int64 -> Maybe TimeSpec -> Flow m '[(), ErrorCode] Source #

Atomically check that addr contains val and sleep until it is wakened up or until the timeout expires

futexWake :: MonadIO m => Ptr Int64 -> Int64 -> Flow m '[Int64, ErrorCode] Source #

Wake count processes waiting on the futex Return the number of processes woken up

futexRequeue :: MonadIO m => Ptr Int64 -> Int64 -> Ptr Int64 -> Flow m '[Int64, ErrorCode] Source #

Wake count processes waiting on the first futex and requeue the other ones on the second futex.

Return the number of processes woken up

futexCompareRequeue :: MonadIO m => Ptr Int64 -> Int64 -> Int64 -> Ptr Int64 -> Flow m '[Int64, ErrorCode] Source #

Atomically compare the first futex with `val, then wake count processes waiting on the first futex and requeue the other ones on the second futex.

Return the number of processes woken up