pthread-0.2.1: Bindings for the pthread library.

Safe HaskellNone
LanguageHaskell2010

System.Posix.Thread

Contents

Description

Bindings to the POSIX threads library.

Requires linking with the -threaded RTS.

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 

Fields

Instances
Show Attributes Source # 
Instance details

Defined in System.Posix.Thread

Generic Attributes Source # 
Instance details

Defined in System.Posix.Thread

Associated Types

type Rep Attributes :: Type -> Type #

Storable Attributes Source # 
Instance details

Defined in System.Posix.Thread

type Rep Attributes Source # 
Instance details

Defined in System.Posix.Thread

data AttributesMonoid Source #

Partial set of thread attributes. Think of it as a diff to apply to the default attributes object.

Constructors

AttributesMonoid 

Fields

Instances
Show AttributesMonoid Source # 
Instance details

Defined in System.Posix.Thread

Generic AttributesMonoid Source # 
Instance details

Defined in System.Posix.Thread

Associated Types

type Rep AttributesMonoid :: Type -> Type #

Semigroup AttributesMonoid Source # 
Instance details

Defined in System.Posix.Thread

Monoid AttributesMonoid Source # 
Instance details

Defined in System.Posix.Thread

Storable AttributesMonoid Source # 
Instance details

Defined in System.Posix.Thread

type Rep AttributesMonoid Source # 
Instance details

Defined in System.Posix.Thread

Thread local storage

data Key Source #

Opaque objects used to locate thread-specific data.

Instances
Eq Key Source # 
Instance details

Defined in System.Posix.Thread

Methods

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

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

Ord Key Source # 
Instance details

Defined in System.Posix.Thread

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 # 
Instance details

Defined in System.Posix.Thread

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

Storable Key Source # 
Instance details

Defined in System.Posix.Thread

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.