Hoogle Search
Within LTS Haskell 24.67 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
ThreadFinished :: ThreadStatusbase GHC.Conc the thread has finished
-
base GHC.Conc 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 ThreadIds. 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 would be difficult to correct while continuing to support threadStatus.
ThreadId :: ThreadId# -> ThreadIdbase GHC.Conc No documentation available.
-
base GHC.Conc the thread is currently runnable or running
-
base GHC.Conc The current status of a thread
killThread :: ThreadId -> IO ()base GHC.Conc killThread raises the ThreadKilled exception in the given thread (GHC only).
killThread tid = throwTo tid ThreadKilled
labelThread :: ThreadId -> String -> IO ()base GHC.Conc labelThread stores a string as identifier for this thread. This identifier will be used in the debugging output to make distinction of different threads easier (otherwise you only have the thread state object's address in the heap). It also emits an event to the RTS eventlog.
-
base GHC.Conc List the Haskell threads of the current process.
mkWeakThreadId :: ThreadId -> IO (Weak ThreadId)base GHC.Conc Make a weak pointer to a ThreadId. It can be important to do this if you want to hold a reference to a ThreadId while still allowing the thread to receive the BlockedIndefinitely family of exceptions (e.g. BlockedIndefinitelyOnMVar). Holding a normal ThreadId reference will prevent the delivery of BlockedIndefinitely exceptions because the reference could be used as the target of throwTo at any time, which would unblock the thread. Holding a Weak ThreadId, on the other hand, will not prevent the thread from receiving BlockedIndefinitely exceptions. It is still possible to throw an exception to a Weak ThreadId, but the caller must use deRefWeak first to determine whether the thread still exists.
-
base GHC.Conc Returns the ThreadId of the calling thread (GHC only).