Safe Haskell | None |
---|---|
Language | Haskell2010 |
Bindings to the POSIX threads library.
Requires linking with the -threaded
RTS.
Synopsis
- create :: IO (Ptr a) -> IO ThreadId
- create_ :: IO () -> IO ThreadId
- createWithAttributes :: AttributesMonoid -> IO (Ptr a) -> IO ThreadId
- createWithAttributes_ :: AttributesMonoid -> IO () -> IO ThreadId
- exit :: Ptr a -> IO ()
- exit_ :: IO ()
- cancel :: ThreadId -> IO ()
- join :: ThreadId -> IO (Ptr a)
- detach :: ThreadId -> IO ()
- myThreadId :: IO ThreadId
- data Attributes = Attributes {
- detachState :: DetachState
- guardSize :: CSize
- inheritSched :: InheritSched
- schedParam :: SchedParam
- schedPolicy :: SchedPolicy
- scope :: Scope
- stack :: Ptr ()
- stackSize :: CSize
- data AttributesMonoid = AttributesMonoid {
- detachState :: First DetachState
- guardSize :: First CSize
- inheritSched :: First InheritSched
- schedParam :: First SchedParam
- schedPolicy :: First SchedPolicy
- scope :: First Scope
- stack :: First (Ptr ())
- stackSize :: First CSize
- data Key
- createKey :: FunPtr (Ptr a -> IO ()) -> IO Key
- createKey_ :: IO Key
- deleteKey :: Key -> IO ()
- setSpecific :: Key -> Ptr a -> IO ()
- getSpecific :: Key -> IO (Ptr a)
Threads
:: 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.
myThreadId :: IO ThreadId Source #
Obtain ID of the calling thread.
Attributes
data Attributes Source #
Thread attributes.
Attributes | |
|
Instances
Show Attributes Source # | |
Defined in System.Posix.Thread showsPrec :: Int -> Attributes -> ShowS # show :: Attributes -> String # showList :: [Attributes] -> ShowS # | |
Generic Attributes Source # | |
Defined in System.Posix.Thread type Rep Attributes :: Type -> Type # from :: Attributes -> Rep Attributes x # to :: Rep Attributes x -> Attributes # | |
Storable Attributes Source # | |
Defined in System.Posix.Thread sizeOf :: Attributes -> Int # alignment :: Attributes -> Int # peekElemOff :: Ptr Attributes -> Int -> IO Attributes # pokeElemOff :: Ptr Attributes -> Int -> Attributes -> IO () # peekByteOff :: Ptr b -> Int -> IO Attributes # pokeByteOff :: Ptr b -> Int -> Attributes -> IO () # peek :: Ptr Attributes -> IO Attributes # poke :: Ptr Attributes -> Attributes -> IO () # | |
type Rep Attributes Source # | |
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.
AttributesMonoid | |
|
Instances
Thread local storage
Opaque objects used to locate thread-specific data.