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 , getNumCapabilities -- :: IO Int
38 , numSparks -- :: IO Int
39 , childHandler -- :: Exception -> IO ()
40 , myThreadId -- :: IO ThreadId
41 , killThread -- :: ThreadId -> IO ()
42 , throwTo -- :: ThreadId -> Exception -> IO ()
43 , par -- :: a -> b -> b
44 , pseq -- :: a -> b -> b
47 , labelThread -- :: ThreadId -> String -> IO ()
49 , ThreadStatus(..), BlockReason(..)
50 , threadStatus -- :: ThreadId -> IO ThreadStatus
53 , threadDelay -- :: Int -> IO ()
54 , registerDelay -- :: Int -> IO (TVar Bool)
55 , threadWaitRead -- :: Int -> IO ()
56 , threadWaitWrite -- :: Int -> IO ()
57 , closeFdWith -- :: (Fd -> IO ()) -> Fd -> IO ()
61 , atomically -- :: STM a -> IO a
63 , orElse -- :: STM a -> STM a -> STM a
64 , throwSTM -- :: Exception e => e -> STM a
65 , catchSTM -- :: Exception e => STM a -> (e -> STM a) -> STM a
66 , alwaysSucceeds -- :: STM a -> STM ()
67 , always -- :: STM Bool -> STM ()
69 , newTVar -- :: a -> STM (TVar a)
70 , newTVarIO -- :: a -> STM (TVar a)
71 , readTVar -- :: TVar a -> STM a
72 , readTVarIO -- :: TVar a -> IO a
73 , writeTVar -- :: a -> TVar a -> STM ()
74 , unsafeIOToSTM -- :: IO a -> STM a
78 #ifdef mingw32_HOST_OS
79 , asyncRead -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)
80 , asyncWrite -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)
81 , asyncDoProc -- :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int
83 , asyncReadBA -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)
84 , asyncWriteBA -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)
87 #ifndef mingw32_HOST_OS
88 , Signal, HandlerFun, setHandler, runHandlers
91 , ensureIOManagerIsRunning
93 #ifdef mingw32_HOST_OS
98 , setUncaughtExceptionHandler -- :: (Exception -> IO ()) -> IO ()
99 , getUncaughtExceptionHandler -- :: IO (Exception -> IO ())
101 , reportError, reportStackOverflow
107 #ifndef mingw32_HOST_OS
108 import GHC.Conc.Signal