Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data ThreadId
- myThreadId :: Member (Embed IO) r => Sem r ThreadId
- killThread :: Member (Embed IO) r => ThreadId -> Sem r ()
- getNumCapabilities :: Member (Embed IO) r => Sem r Int
- threadCapability :: Member (Embed IO) r => ThreadId -> Sem r (Int, Bool)
- yield :: Member (Embed IO) r => Sem r ()
- threadDelay :: Member (Embed IO) r => Int -> Sem r ()
- isCurrentThreadBound :: Member (Embed IO) r => Sem r Bool
- mkWeakThreadId :: Member (Embed IO) r => ThreadId -> Sem r (Weak ThreadId)
Documentation
A ThreadId
is an abstract type representing a handle to a thread.
ThreadId
is an instance of Eq
, Ord
and Show
, where
the Ord
instance implements an arbitrary total ordering over
ThreadId
s. The Show
instance lets you convert an arbitrary-valued
ThreadId
to string form; showing a ThreadId
value is occasionally
useful when debugging or diagnosing the behaviour of a concurrent
program.
Note: in GHC, if you have a ThreadId
, you essentially have
a pointer to the thread itself. This means the thread itself can't be
garbage collected until you drop the ThreadId
.
This misfeature will hopefully be corrected at a later date.
Instances
Show ThreadId | Since: base-4.2.0.0 |
NFData ThreadId | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
Eq ThreadId | Since: base-4.2.0.0 |
Ord ThreadId | Since: base-4.2.0.0 |
Defined in GHC.Conc.Sync | |
Hashable ThreadId | |
Defined in Data.Hashable.Class |