diff options
-rw-r--r-- | libraries/base/GHC/Conc/Sync.hs | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/libraries/base/GHC/Conc/Sync.hs b/libraries/base/GHC/Conc/Sync.hs index dbc81e1848..6ae26678aa 100644 --- a/libraries/base/GHC/Conc/Sync.hs +++ b/libraries/base/GHC/Conc/Sync.hs @@ -29,34 +29,41 @@ -- #not-home module GHC.Conc.Sync - ( ThreadId(..) + ( + -- * Threads + ThreadId(..) , showThreadId + , myThreadId + , killThread + , throwTo + , yield + , labelThread + , mkWeakThreadId + + , ThreadStatus(..), BlockReason(..) + , threadStatus + , threadCapability -- * Forking and suchlike , forkIO , forkIOWithUnmask , forkOn , forkOnWithUnmask + + -- * Capabilities , numCapabilities , getNumCapabilities , setNumCapabilities , getNumProcessors + + -- * Sparks , numSparks , childHandler - , myThreadId - , killThread - , throwTo , par , pseq , runSparks - , yield - , labelThread - , mkWeakThreadId - - , ThreadStatus(..), BlockReason(..) - , threadStatus - , threadCapability + -- * PrimMVar , newStablePtrPrimMVar, PrimMVar -- * Allocation counter and quota @@ -622,10 +629,10 @@ mkWeakThreadId t@(ThreadId t#) = IO $ \s -> data PrimMVar --- | Make a StablePtr that can be passed to the C function --- @hs_try_putmvar()@. The RTS wants a 'StablePtr' to the underlying --- 'MVar#', but a 'StablePtr#' can only refer to lifted types, so we --- have to cheat by coercing. +-- | Make a 'StablePtr' that can be passed to the C function +-- @hs_try_putmvar()@. The RTS wants a 'StablePtr' to the +-- underlying 'MVar#', but a 'StablePtr#' can only refer to +-- lifted types, so we have to cheat by coercing. newStablePtrPrimMVar :: MVar a -> IO (StablePtr PrimMVar) newStablePtrPrimMVar (MVar m) = IO $ \s0 -> case makeStablePtr# (unsafeCoerce# m :: PrimMVar) s0 of |