pthread-0.2.0: Bindings for the pthread library.

Safe HaskellNone
LanguageHaskell2010

System.Posix.Thread

Contents

Description

Bindings to the POSIX threads library.

Synopsis

Threads

create :: IO (Ptr a) -> IO ThreadId Source #

Create a new thread.

create_ :: IO () -> IO ThreadId Source #

Like create, but with an IO computation that returns nothing.

createWithAttributes Source #

Arguments

:: AttributesMonoid 
-> IO (Ptr a)

Created thread runs this IO computation.

-> IO ThreadId 

Create a new thread.

createWithAttributes_ :: AttributesMonoid -> IO () -> IO ThreadId Source #

Like createWithAttributes, but with an IO computation that returns nothing.

exit :: Ptr a -> IO () Source #

Terminate calling thread.

exit_ :: IO () Source #

Like exit, but don't return anything.

cancel :: ThreadId -> IO () Source #

Send a cancellation request to a thread.

join :: ThreadId -> IO (Ptr a) Source #

Join with a terminated thread.

detach :: ThreadId -> IO () Source #

Detach a thread.

myThreadId :: IO ThreadId Source #

Obtain ID of the calling thread.

Attributes

data Attributes Source #

Thread attributes.

Constructors

Attributes DetachState CSize InheritSched SchedParam SchedPolicy Scope (Ptr ()) CSize 

Thread local storage

data Key Source #

Opaque objects used to locate thread-specific data.

Instances

Eq Key Source # 

Methods

(==) :: Key -> Key -> Bool #

(/=) :: Key -> Key -> Bool #

Ord Key Source # 

Methods

compare :: Key -> Key -> Ordering #

(<) :: Key -> Key -> Bool #

(<=) :: Key -> Key -> Bool #

(>) :: Key -> Key -> Bool #

(>=) :: Key -> Key -> Bool #

max :: Key -> Key -> Key #

min :: Key -> Key -> Key #

Show Key Source # 

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

Storable Key Source # 

Methods

sizeOf :: Key -> Int #

alignment :: Key -> Int #

peekElemOff :: Ptr Key -> Int -> IO Key #

pokeElemOff :: Ptr Key -> Int -> Key -> IO () #

peekByteOff :: Ptr b -> Int -> IO Key #

pokeByteOff :: Ptr b -> Int -> Key -> IO () #

peek :: Ptr Key -> IO Key #

poke :: Ptr Key -> Key -> IO () #

createKey Source #

Arguments

:: FunPtr (Ptr a -> IO ())

Finalizer

-> IO Key 

Thread-specific data key creation.

createKey_ :: IO Key Source #

Like createKey, but with no finalizer.

deleteKey :: Key -> IO () Source #

Thread-specific data key deletion.

setSpecific :: Key -> Ptr a -> IO () Source #

Associate a thread-specific value with a key obtained via a previous call to createKey.

getSpecific :: Key -> IO (Ptr a) Source #

Return the value currently bound to the specified key on behalf of the calling thread.