base: Manually unlit .lhs into .hs modules
[ghc.git] / libraries / base / GHC / Conc.hs
1 {-# LANGUAGE Unsafe #-}
2 {-# LANGUAGE CPP, NoImplicitPrelude #-}
3 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
4 {-# OPTIONS_HADDOCK not-home #-}
5
6 -----------------------------------------------------------------------------
7 -- |
8 -- Module : GHC.Conc
9 -- Copyright : (c) The University of Glasgow, 1994-2002
10 -- License : see libraries/base/LICENSE
11 --
12 -- Maintainer : cvs-ghc@haskell.org
13 -- Stability : internal
14 -- Portability : non-portable (GHC extensions)
15 --
16 -- Basic concurrency stuff.
17 --
18 -----------------------------------------------------------------------------
19
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: #not-home
24
25 module GHC.Conc
26 ( ThreadId(..)
27
28 -- * Forking and suchlike
29 , forkIO
30 , forkIOWithUnmask
31 , forkOn
32 , forkOnWithUnmask
33 , numCapabilities
34 , getNumCapabilities
35 , setNumCapabilities
36 , getNumProcessors
37 , numSparks
38 , childHandler
39 , myThreadId
40 , killThread
41 , throwTo
42 , par
43 , pseq
44 , runSparks
45 , yield
46 , labelThread
47 , mkWeakThreadId
48
49 , ThreadStatus(..), BlockReason(..)
50 , threadStatus
51 , threadCapability
52
53 -- * Waiting
54 , threadDelay
55 , registerDelay
56 , threadWaitRead
57 , threadWaitWrite
58 , threadWaitReadSTM
59 , threadWaitWriteSTM
60 , closeFdWith
61
62 -- * TVars
63 , STM(..)
64 , atomically
65 , retry
66 , orElse
67 , throwSTM
68 , catchSTM
69 , alwaysSucceeds
70 , always
71 , TVar(..)
72 , newTVar
73 , newTVarIO
74 , readTVar
75 , readTVarIO
76 , writeTVar
77 , unsafeIOToSTM
78
79 -- * Miscellaneous
80 , withMVar
81 #ifdef mingw32_HOST_OS
82 , asyncRead
83 , asyncWrite
84 , asyncDoProc
85
86 , asyncReadBA
87 , asyncWriteBA
88 #endif
89
90 #ifndef mingw32_HOST_OS
91 , Signal, HandlerFun, setHandler, runHandlers
92 #endif
93
94 , ensureIOManagerIsRunning
95 , ioManagerCapabilitiesChanged
96
97 #ifdef mingw32_HOST_OS
98 , ConsoleEvent(..)
99 , win32ConsoleHandler
100 , toWin32ConsoleEvent
101 #endif
102 , setUncaughtExceptionHandler
103 , getUncaughtExceptionHandler
104
105 , reportError, reportStackOverflow
106 ) where
107
108 import GHC.Conc.IO
109 import GHC.Conc.Sync
110
111 #ifndef mingw32_HOST_OS
112 import GHC.Conc.Signal
113 #endif