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
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
......@@ -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
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