2 {-# LANGUAGE CPP, NoImplicitPrelude #-}
3 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
4 {-# OPTIONS_HADDOCK not-home #-}
6 -----------------------------------------------------------------------------
9 -- Copyright : (c) The University of Glasgow, 1994-2002
10 -- License : see libraries/base/LICENSE
12 -- Maintainer : cvs-ghc@haskell.org
13 -- Stability : internal
14 -- Portability : non-portable (GHC extensions)
16 -- Basic concurrency stuff.
18 -----------------------------------------------------------------------------
20 -- No: #hide, because bits of this module are exposed by the stm package.
21 -- However, we don't want this module to be the home location for the
22 -- bits it exports, we'd rather have Control.Concurrent and the other
23 -- higher level modules be the home. Hence:
31 -- * Forking and suchlike
32 , forkIO -- :: IO a -> IO ThreadId
34 , forkOnIO -- :: Int -> IO a -> IO ThreadId
36 , numCapabilities -- :: Int
37 , numSparks -- :: IO Int
38 , childHandler -- :: Exception -> IO ()
39 , myThreadId -- :: IO ThreadId
40 , killThread -- :: ThreadId -> IO ()
41 , throwTo -- :: ThreadId -> Exception -> IO ()
42 , par -- :: a -> b -> b
43 , pseq -- :: a -> b -> b
46 , labelThread -- :: ThreadId -> String -> IO ()
48 , ThreadStatus(..), BlockReason(..)
49 , threadStatus -- :: ThreadId -> IO ThreadStatus
52 , threadDelay -- :: Int -> IO ()
53 , registerDelay -- :: Int -> IO (TVar Bool)
54 , threadWaitRead -- :: Int -> IO ()
55 , threadWaitWrite -- :: Int -> IO ()
56 , closeFdWith -- :: (Fd -> IO ()) -> Fd -> IO ()
60 , atomically -- :: STM a -> IO a
62 , orElse -- :: STM a -> STM a -> STM a
63 , throwSTM -- :: Exception e => e -> STM a
64 , catchSTM -- :: Exception e => STM a -> (e -> STM a) -> STM a
65 , alwaysSucceeds -- :: STM a -> STM ()
66 , always -- :: STM Bool -> STM ()
68 , newTVar -- :: a -> STM (TVar a)
69 , newTVarIO -- :: a -> STM (TVar a)
70 , readTVar -- :: TVar a -> STM a
71 , readTVarIO -- :: TVar a -> IO a
72 , writeTVar -- :: a -> TVar a -> STM ()
73 , unsafeIOToSTM -- :: IO a -> STM a
77 #ifdef mingw32_HOST_OS
78 , asyncRead -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)
79 , asyncWrite -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)
80 , asyncDoProc -- :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int
82 , asyncReadBA -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)
83 , asyncWriteBA -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)
86 #ifndef mingw32_HOST_OS
87 , Signal, HandlerFun, setHandler, runHandlers
90 , ensureIOManagerIsRunning
92 #ifdef mingw32_HOST_OS
97 , setUncaughtExceptionHandler -- :: (Exception -> IO ()) -> IO ()
98 , getUncaughtExceptionHandler -- :: IO (Exception -> IO ())
100 , reportError, reportStackOverflow
106 #ifndef mingw32_HOST_OS
107 import GHC.Conc.Signal