% -----------------------------------------------------------------------------
-% $Id: Conc.lhs,v 1.3 2001/12/21 15:07:22 simonmar Exp $
+% $Id: Conc.lhs,v 1.4 2002/04/10 11:43:49 stolz Exp $
%
% (c) The University of Glasgow, 1994-2000
%
, par -- :: a -> b -> b
, pseq -- :: a -> b -> b
, yield -- :: IO ()
+ , labelThread -- :: String -> IO ()
+ , forkProcess -- :: IO Int
-- Waiting
, threadDelay -- :: Int -> IO ()
import GHC.IOBase ( IO(..), MVar(..) )
import GHC.Base ( Int(..) )
import GHC.Exception ( Exception(..), AsyncException(..) )
+import GHC.Pack ( packCString# )
infixr 0 `par`, `pseq`
\end{code}
yield = IO $ \s ->
case (yield# s) of s1 -> (# s1, () #)
+labelThread :: String -> IO ()
+labelThread str = IO $ \ s ->
+ let ps = packCString# str
+ adr = byteArrayContents# ps in
+ case (labelThread# adr s) of s1 -> (# s1, () #)
+
+forkProcess :: IO Int
+forkProcess = IO $ \s -> case (forkProcess# s) of (# s1, id #) -> (# s1, (I# id) #)
+
-- Nota Bene: 'pseq' used to be 'seq'
-- but 'seq' is now defined in PrelGHC
--