Skip to content
Snippets Groups Projects
Commit 3fe02e4c authored by Simon Marlow's avatar Simon Marlow
Browse files

[project @ 1998-08-17 10:59:01 by simonm]

Update tests now that the death of the main thread ends the program.
parent ab36e594
No related branches found
No related tags found
No related merge requests found
...@@ -7,9 +7,9 @@ import Concurrent ...@@ -7,9 +7,9 @@ import Concurrent
main = do main = do
s <- newEmptyMVar s <- newEmptyMVar
let let
reader = do write = do
str <- takeMVar s putMVar s "hello world\n"
putStr str
forkIO reader forkIO write
putMVar s "hello world\n" str <- takeMVar s
putStr str
...@@ -4,12 +4,11 @@ import Concurrent ...@@ -4,12 +4,11 @@ import Concurrent
main = do main = do
c <- newChan c <- newChan
let let writer = writeList2Chan c "Hello World\n"
reader = do forkIO writer
char <- readChan c let reader = do char <- readChan c
if (char == '\n') if (char == '\n')
then return () then return ()
else do putChar char; reader else do putChar char; reader
forkIO reader reader
writeList2Chan c "Hello World\n"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment