From: sof Date: Fri, 14 May 1999 19:49:23 +0000 (+0000) Subject: [project @ 1999-05-14 19:49:22 by sof] X-Git-Tag: Approximately_9120_patches~6209 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=3a21a064deb60983eeeb521e9c68316d0e8cb3fa;p=ghc-hetmet.git [project @ 1999-05-14 19:49:22 by sof] Added (yield :: IO ()) - the underlying bits were already there, really. --- diff --git a/ghc/lib/concurrent/Concurrent.lhs b/ghc/lib/concurrent/Concurrent.lhs index 2fe58d3..c9c2240 100644 --- a/ghc/lib/concurrent/Concurrent.lhs +++ b/ghc/lib/concurrent/Concurrent.lhs @@ -29,6 +29,8 @@ module Concurrent ( , par -- :: a -> b -> b , seq -- :: a -> b -> b , fork -- :: a -> b -> b + , yield -- :: IO () + {-threadDelay, threadWaitRead, threadWaitWrite,-} -- MVars diff --git a/ghc/lib/std/PrelConc.lhs b/ghc/lib/std/PrelConc.lhs index 10ebbe4..c23e8d8 100644 --- a/ghc/lib/std/PrelConc.lhs +++ b/ghc/lib/std/PrelConc.lhs @@ -18,6 +18,8 @@ module PrelConc , raiseInThread -- :: ThreadId -> Exception -> IO () , par -- :: a -> b -> b , seq -- :: a -> b -> b + , yield -- :: IO () + {-threadDelay, threadWaitRead, threadWaitWrite,-} -- MVars @@ -68,6 +70,10 @@ myThreadId :: IO ThreadId myThreadId = IO $ \s -> case (myThreadId# s) of (# s1, id #) -> (# s1, ThreadId id #) +yield :: IO () +yield = IO $ \s -> + case (yield# s) of s1 -> (# s1, () #) + -- "seq" is defined a bit wierdly (see below) -- -- The reason for the strange "0# -> parError" case is that