From 4d888c9c94a784ac8e4f07c34e10e3b14172f624 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 7 Aug 2001 15:25:04 +0000 Subject: [PATCH] [project @ 2001-08-07 15:25:04 by simonmar] Remove 'fork' (unsafe, and not used), and don't export 'seq' and 'par'. --- Control/Concurrent.hs | 61 +++++++++++++++++++------------------------------ 1 file changed, 23 insertions(+), 38 deletions(-) diff --git a/Control/Concurrent.hs b/Control/Concurrent.hs index 033f2cc..1409b75 100644 --- a/Control/Concurrent.hs +++ b/Control/Concurrent.hs @@ -8,47 +8,40 @@ -- Stability : experimental -- Portability : non-portable -- --- $Id: Concurrent.hs,v 1.1 2001/06/28 14:15:01 simonmar Exp $ +-- $Id: Concurrent.hs,v 1.2 2001/08/07 15:25:04 simonmar Exp $ -- -- A common interface to a collection of useful concurrency -- abstractions. -- ----------------------------------------------------------------------------- -module Control.Concurrent - ( module Control.Concurrent.Chan - , module Control.Concurrent.CVar - , module Control.Concurrent.MVar - , module Control.Concurrent.QSem - , module Control.Concurrent.QSemN - , module Control.Concurrent.SampleVar +module Control.Concurrent ( + module Control.Concurrent.Chan, + module Control.Concurrent.CVar, + module Control.Concurrent.MVar, + module Control.Concurrent.QSem, + module Control.Concurrent.QSemN, + module Control.Concurrent.SampleVar, -#ifdef __HUGS__ - , forkIO -- :: IO () -> IO () -#elif defined(__GLASGOW_HASKELL__) - , ThreadId + forkIO, -- :: IO () -> IO () + yield, -- :: IO () - -- Forking and suchlike - , myThreadId -- :: IO ThreadId - , killThread -- :: ThreadId -> IO () - , throwTo -- :: ThreadId -> Exception -> IO () -#endif - , par -- :: a -> b -> b - , seq -- :: a -> b -> b #ifdef __GLASGOW_HASKELL__ - , fork -- :: a -> b -> b -#endif - , yield -- :: IO () + ThreadId, -#ifdef __GLASGOW_HASKELL__ - , threadDelay -- :: Int -> IO () - , threadWaitRead -- :: Int -> IO () - , threadWaitWrite -- :: Int -> IO () + -- Forking and suchlike + myThreadId, -- :: IO ThreadId + killThread, -- :: ThreadId -> IO () + throwTo, -- :: ThreadId -> Exception -> IO () + + threadDelay, -- :: Int -> IO () + threadWaitRead, -- :: Int -> IO () + threadWaitWrite, -- :: Int -> IO () #endif -- merging of streams - , mergeIO -- :: [a] -> [a] -> IO [a] - , nmergeIO -- :: [[a]] -> IO [a] + mergeIO, -- :: [a] -> [a] -> IO [a] + nmergeIO -- :: [[a]] -> IO [a] ) where import Prelude @@ -59,13 +52,13 @@ import Control.Exception as Exception import GHC.Conc import GHC.TopHandler ( reportStackOverflow, reportError ) import GHC.IOBase ( IO(..) ) -import GHC.IOBase ( unsafePerformIO , unsafeInterleaveIO ) +import GHC.IOBase ( unsafeInterleaveIO ) import GHC.Base ( fork# ) import GHC.Prim ( Addr#, unsafeCoerce# ) #endif #ifdef __HUGS__ -import IOExts ( unsafeInterleaveIO, unsafePerformIO ) +import IOExts ( unsafeInterleaveIO ) import ConcBase #endif @@ -76,10 +69,6 @@ import Control.Concurrent.QSem import Control.Concurrent.QSemN import Control.Concurrent.SampleVar -#ifdef __GLASGOW_HASKELL__ -infixr 0 `fork` -#endif - -- Thread Ids, specifically the instances of Eq and Ord for these things. -- The ThreadId type itself is defined in std/PrelConc.lhs. @@ -127,10 +116,6 @@ real_handler ex = ErrorCall s -> reportError False s other -> reportError False (showsPrec 0 other "\n") -{-# INLINE fork #-} -fork :: a -> b -> b -fork x y = unsafePerformIO (forkIO (x `seq` return ())) `seq` y - #endif /* __GLASGOW_HASKELL__ */ -- 1.7.10.4