[project @ 1998-08-17 10:59:01 by simonm]
authorsimonm <unknown>
Mon, 17 Aug 1998 10:59:01 +0000 (10:59 +0000)
committersimonm <unknown>
Mon, 17 Aug 1998 10:59:01 +0000 (10:59 +0000)
Update tests now that the death of the main thread ends the program.

ghc/tests/concurrent/should_run/conc001.hs
ghc/tests/concurrent/should_run/conc002.hs

index 8f7f3fe..0468727 100644 (file)
@@ -7,9 +7,9 @@ import Concurrent
 main = do
   s <- newEmptyMVar
   let 
-    reader = do
-       str <- takeMVar s
-       putStr str
+    write = do
+       putMVar s "hello world\n"
 
-  forkIO reader
-  putMVar s "hello world\n"
+  forkIO write
+  str <- takeMVar s
+  putStr str
index 4e876f8..7008802 100644 (file)
@@ -4,12 +4,11 @@ import Concurrent
 
 main = do
   c <- newChan
-  let 
-    reader = do
-       char <- readChan c
-       if (char == '\n') 
-               then return () 
-               else do putChar char; reader    
-  forkIO reader
-  writeList2Chan c "Hello World\n"
+  let  writer = writeList2Chan c "Hello World\n"
+  forkIO writer
+  let  reader = do  char <- readChan c
+                   if (char == '\n') 
+                       then return () 
+                       else do putChar char; reader    
+  reader