sdl2-2.5.5.1: Both high- and low-level bindings to the SDL library (version 2.0.6+).

Safe Haskell | Safe-Inferred
Language | Haskell2010

SDL.Raw.Thread

Contents

- Thread Management
- Thread Synchronization Primitives
- Atomic Operations

Synopsis

- createThread :: MonadIO m => ThreadFunction -> CString -> m (Ptr ())
- detachThread :: MonadIO m => Ptr Thread -> m ()
- getThreadID :: MonadIO m => Ptr Thread -> m ThreadID
- getThreadName :: MonadIO m => Ptr Thread -> m CString
- setThreadPriority :: MonadIO m => ThreadPriority -> m CInt
- tlsCreate :: MonadIO m => m TLSID
- tlsGet :: MonadIO m => TLSID -> m (Ptr ())
- tlsSet :: MonadIO m => TLSID -> Ptr () -> FunPtr (Ptr () -> IO ()) -> m CInt
- threadID :: MonadIO m => m ThreadID
- waitThread :: MonadIO m => Ptr Thread -> Ptr CInt -> m ()
- condBroadcast :: MonadIO m => Ptr Cond -> m CInt
- condSignal :: MonadIO m => Ptr Cond -> m CInt
- condWait :: MonadIO m => Ptr Cond -> Ptr Mutex -> m CInt
- condWaitTimeout :: MonadIO m => Ptr Cond -> Ptr Mutex -> Word32 -> m CInt
- createCond :: MonadIO m => m (Ptr Cond)
- createMutex :: MonadIO m => m (Ptr Mutex)
- createSemaphore :: MonadIO m => Word32 -> m (Ptr Sem)
- destroyCond :: MonadIO m => Ptr Cond -> m ()
- destroyMutex :: MonadIO m => Ptr Mutex -> m ()
- destroySemaphore :: MonadIO m => Ptr Sem -> m ()
- lockMutex :: MonadIO m => Ptr Mutex -> m CInt
- semPost :: MonadIO m => Ptr Sem -> m CInt
- semTryWait :: MonadIO m => Ptr Sem -> m CInt
- semValue :: MonadIO m => Ptr Sem -> m Word32
- semWait :: MonadIO m => Ptr Sem -> m CInt
- semWaitTimeout :: MonadIO m => Ptr Sem -> Word32 -> m CInt
- tryLockMutex :: MonadIO m => Ptr Mutex -> m CInt
- unlockMutex :: MonadIO m => Ptr Mutex -> m CInt
- atomicAdd :: MonadIO m => Ptr Atomic -> CInt -> m CInt
- atomicCAS :: MonadIO m => Ptr Atomic -> CInt -> CInt -> m Bool
- atomicCASPtr :: MonadIO m => Ptr (Ptr ()) -> Ptr () -> Ptr () -> m Bool
- atomicDecRef :: Ptr Atomic -> IO Bool
- atomicGet :: MonadIO m => Ptr Atomic -> m CInt
- atomicGetPtr :: MonadIO m => Ptr (Ptr ()) -> m (Ptr ())
- atomicIncRef :: Ptr Atomic -> IO CInt
- atomicLock :: MonadIO m => Ptr SpinLock -> m ()
- atomicSet :: MonadIO m => Ptr Atomic -> CInt -> m CInt
- atomicSetPtr :: MonadIO m => Ptr (Ptr ()) -> Ptr () -> m (Ptr ())
- atomicTryLock :: MonadIO m => Ptr SpinLock -> m Bool
- atomicUnlock :: MonadIO m => Ptr SpinLock -> m ()

# Thread Management

createThread :: MonadIO m => ThreadFunction -> CString -> m (Ptr ()) Source #

detachThread :: MonadIO m => Ptr Thread -> m () Source #

getThreadID :: MonadIO m => Ptr Thread -> m ThreadID Source #

getThreadName :: MonadIO m => Ptr Thread -> m CString Source #

setThreadPriority :: MonadIO m => ThreadPriority -> m CInt Source #

tlsCreate :: MonadIO m => m TLSID Source #

tlsGet :: MonadIO m => TLSID -> m (Ptr ()) Source #

tlsSet :: MonadIO m => TLSID -> Ptr () -> FunPtr (Ptr () -> IO ()) -> m CInt Source #

threadID :: MonadIO m => m ThreadID Source #

waitThread :: MonadIO m => Ptr Thread -> Ptr CInt -> m () Source #

# Thread Synchronization Primitives

condBroadcast :: MonadIO m => Ptr Cond -> m CInt Source #

condSignal :: MonadIO m => Ptr Cond -> m CInt Source #

condWait :: MonadIO m => Ptr Cond -> Ptr Mutex -> m CInt Source #

condWaitTimeout :: MonadIO m => Ptr Cond -> Ptr Mutex -> Word32 -> m CInt Source #

createCond :: MonadIO m => m (Ptr Cond) Source #

createMutex :: MonadIO m => m (Ptr Mutex) Source #

createSemaphore :: MonadIO m => Word32 -> m (Ptr Sem) Source #

destroyCond :: MonadIO m => Ptr Cond -> m () Source #

destroyMutex :: MonadIO m => Ptr Mutex -> m () Source #

destroySemaphore :: MonadIO m => Ptr Sem -> m () Source #

lockMutex :: MonadIO m => Ptr Mutex -> m CInt Source #

semPost :: MonadIO m => Ptr Sem -> m CInt Source #

semTryWait :: MonadIO m => Ptr Sem -> m CInt Source #

semValue :: MonadIO m => Ptr Sem -> m Word32 Source #

semWait :: MonadIO m => Ptr Sem -> m CInt Source #

semWaitTimeout :: MonadIO m => Ptr Sem -> Word32 -> m CInt Source #

tryLockMutex :: MonadIO m => Ptr Mutex -> m CInt Source #

unlockMutex :: MonadIO m => Ptr Mutex -> m CInt Source #

# Atomic Operations

atomicAdd :: MonadIO m => Ptr Atomic -> CInt -> m CInt Source #

atomicCAS :: MonadIO m => Ptr Atomic -> CInt -> CInt -> m Bool Source #

atomicCASPtr :: MonadIO m => Ptr (Ptr ()) -> Ptr () -> Ptr () -> m Bool Source #

atomicDecRef :: Ptr Atomic -> IO Bool Source #

atomicGet :: MonadIO m => Ptr Atomic -> m CInt Source #

atomicGetPtr :: MonadIO m => Ptr (Ptr ()) -> m (Ptr ()) Source #

atomicIncRef :: Ptr Atomic -> IO CInt Source #

atomicLock :: MonadIO m => Ptr SpinLock -> m () Source #

atomicSet :: MonadIO m => Ptr Atomic -> CInt -> m CInt Source #

atomicSetPtr :: MonadIO m => Ptr (Ptr ()) -> Ptr () -> m (Ptr ()) Source #

atomicTryLock :: MonadIO m => Ptr SpinLock -> m Bool Source #

atomicUnlock :: MonadIO m => Ptr SpinLock -> m () Source #