From 3a21a064deb60983eeeb521e9c68316d0e8cb3fa Mon Sep 17 00:00:00 2001 From: sof Date: Fri, 14 May 1999 19:49:23 +0000 Subject: [PATCH] [project @ 1999-05-14 19:49:22 by sof] Added (yield :: IO ()) - the underlying bits were already there, really. --- ghc/lib/concurrent/Concurrent.lhs | 2 ++ ghc/lib/std/PrelConc.lhs | 6 ++++++ 2 files changed, 8 insertions(+) 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 -- 1.7.10.4