2 {-# OPTIONS_GHC -XNoImplicitPrelude #-}
3 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
4 {-# OPTIONS_HADDOCK not-home #-}
5 -----------------------------------------------------------------------------
8 -- Copyright : (c) The University of Glasgow, 1994-2002
9 -- License : see libraries/base/LICENSE
11 -- Maintainer : cvs-ghc@haskell.org
12 -- Stability : internal
13 -- Portability : non-portable (GHC extensions)
15 -- Basic concurrency stuff.
17 -----------------------------------------------------------------------------
19 -- No: #hide, because bits of this module are exposed by the stm package.
20 -- However, we don't want this module to be the home location for the
21 -- bits it exports, we'd rather have Control.Concurrent and the other
22 -- higher level modules be the home. Hence:
30 -- * Forking and suchlike
31 , forkIO -- :: IO a -> IO ThreadId
33 , forkOnIO -- :: Int -> IO a -> IO ThreadId
35 , numCapabilities -- :: Int
36 , numSparks -- :: IO Int
37 , childHandler -- :: Exception -> IO ()
38 , myThreadId -- :: IO ThreadId
39 , killThread -- :: ThreadId -> IO ()
40 , throwTo -- :: ThreadId -> Exception -> IO ()
41 , par -- :: a -> b -> b
42 , pseq -- :: a -> b -> b
45 , labelThread -- :: ThreadId -> String -> IO ()
47 , ThreadStatus(..), BlockReason(..)
48 , threadStatus -- :: ThreadId -> IO ThreadStatus
51 , threadDelay -- :: Int -> IO ()
52 , registerDelay -- :: Int -> IO (TVar Bool)
53 , threadWaitRead -- :: Int -> IO ()
54 , threadWaitWrite -- :: Int -> IO ()
55 , closeFd -- :: (Int -> IO ()) -> Int -> IO ()
59 , atomically -- :: STM a -> IO a
61 , orElse -- :: STM a -> STM a -> STM a
62 , throwSTM -- :: Exception e => e -> STM a
63 , catchSTM -- :: Exception e => STM a -> (e -> STM a) -> STM a
64 , alwaysSucceeds -- :: STM a -> STM ()
65 , always -- :: STM Bool -> STM ()
67 , newTVar -- :: a -> STM (TVar a)
68 , newTVarIO -- :: a -> STM (TVar a)
69 , readTVar -- :: TVar a -> STM a
70 , readTVarIO -- :: TVar a -> IO a
71 , writeTVar -- :: a -> TVar a -> STM ()
72 , unsafeIOToSTM -- :: IO a -> STM a
76 #ifdef mingw32_HOST_OS
77 , asyncRead -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)
78 , asyncWrite -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)
79 , asyncDoProc -- :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int
81 , asyncReadBA -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)
82 , asyncWriteBA -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)
85 #ifndef mingw32_HOST_OS
86 , Signal, HandlerFun, setHandler, runHandlers
89 , ensureIOManagerIsRunning
91 #ifdef mingw32_HOST_OS
96 , setUncaughtExceptionHandler -- :: (Exception -> IO ()) -> IO ()
97 , getUncaughtExceptionHandler -- :: IO (Exception -> IO ())
99 , reportError, reportStackOverflow
105 #ifndef mingw32_HOST_OS
106 import GHC.Conc.Signal