Conc.lhs 2.78 KB
Newer Older
sof's avatar
sof committed
1
\begin{code}
2
{-# LANGUAGE Unsafe #-}
3
{-# LANGUAGE CPP, NoImplicitPrelude #-}
Ian Lynagh's avatar
Ian Lynagh committed
4
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
5
{-# OPTIONS_HADDOCK not-home #-}
6

7 8 9 10 11 12 13 14 15 16 17 18 19
-----------------------------------------------------------------------------
-- |
-- Module      :  GHC.Conc
-- Copyright   :  (c) The University of Glasgow, 1994-2002
-- License     :  see libraries/base/LICENSE
-- 
-- Maintainer  :  cvs-ghc@haskell.org
-- Stability   :  internal
-- Portability :  non-portable (GHC extensions)
--
-- Basic concurrency stuff.
-- 
-----------------------------------------------------------------------------
20

21
-- No: #hide, because bits of this module are exposed by the stm package.
22 23
-- However, we don't want this module to be the home location for the
-- bits it exports, we'd rather have Control.Concurrent and the other
24
-- higher level modules be the home.  Hence: #not-home
25

26
module GHC.Conc
Don Stewart's avatar
Don Stewart committed
27
        ( ThreadId(..)
28

Don Stewart's avatar
Don Stewart committed
29
        -- * Forking and suchlike
30
        , forkIO
31
        , forkIOWithUnmask
32 33
        , forkOn
        , forkOnWithUnmask
34 35 36 37 38 39 40 41 42 43 44
        , numCapabilities
        , getNumCapabilities
        , setNumCapabilities
        , getNumProcessors
        , numSparks
        , childHandler
        , myThreadId
        , killThread
        , throwTo
        , par
        , pseq
45
        , runSparks
46 47 48
        , yield
        , labelThread
        , mkWeakThreadId
Don Stewart's avatar
Don Stewart committed
49

50
        , ThreadStatus(..), BlockReason(..)
51
        , threadStatus
52
        , threadCapability
53

Don Stewart's avatar
Don Stewart committed
54
        -- * Waiting
55 56 57 58
        , threadDelay
        , registerDelay
        , threadWaitRead
        , threadWaitWrite
59 60
        , threadWaitReadSTM
        , threadWaitWriteSTM
61
        , closeFdWith
Don Stewart's avatar
Don Stewart committed
62

63 64 65 66 67 68
        -- * Allocation counter and limit
        , setAllocationCounter
        , getAllocationCounter
        , enableAllocationLimit
        , disableAllocationLimit

Don Stewart's avatar
Don Stewart committed
69 70
        -- * TVars
        , STM(..)
71 72 73 74 75 76 77
        , atomically
        , retry
        , orElse
        , throwSTM
        , catchSTM
        , alwaysSucceeds
        , always
Don Stewart's avatar
Don Stewart committed
78
        , TVar(..)
79 80 81 82 83 84
        , newTVar
        , newTVarIO
        , readTVar
        , readTVarIO
        , writeTVar
        , unsafeIOToSTM
Don Stewart's avatar
Don Stewart committed
85 86

        -- * Miscellaneous
87
        , withMVar
88
#ifdef mingw32_HOST_OS
89 90 91
        , asyncRead
        , asyncWrite
        , asyncDoProc
sof's avatar
sof committed
92

93 94
        , asyncReadBA
        , asyncWriteBA
sof's avatar
sof committed
95
#endif
96

97
#ifndef mingw32_HOST_OS
98
        , Signal, HandlerFun, setHandler, runHandlers
99 100
#endif

Don Stewart's avatar
Don Stewart committed
101
        , ensureIOManagerIsRunning
102
        , ioManagerCapabilitiesChanged
103 104 105 106 107 108

#ifdef mingw32_HOST_OS
        , ConsoleEvent(..)
        , win32ConsoleHandler
        , toWin32ConsoleEvent
#endif
109 110
        , setUncaughtExceptionHandler
        , getUncaughtExceptionHandler
111

112
        , reportError, reportStackOverflow
sof's avatar
sof committed
113
        ) where
114

Simon Marlow's avatar
Simon Marlow committed
115 116
import GHC.Conc.IO
import GHC.Conc.Sync
117

118
#ifndef mingw32_HOST_OS
Simon Marlow's avatar
Simon Marlow committed
119
import GHC.Conc.Signal
120 121
#endif

122
\end{code}