[project @ 2004-11-22 10:26:46 by simonmar]
authorsimonmar <unknown>
Mon, 22 Nov 2004 10:26:46 +0000 (10:26 +0000)
committersimonmar <unknown>
Mon, 22 Nov 2004 10:26:46 +0000 (10:26 +0000)
More fixes to the sample code (thanks to Satnam Singh for pointing out
a problem).

Control/Concurrent.hs

index e820d17..3b7f784 100644 (file)
@@ -506,9 +506,9 @@ runInUnboundThread action = do
 >    forkChild :: IO () -> IO ()
 >    forkChild io = do
 >       mvar <- newEmptyMVar
->       forkIO (io `finally` putMVar mvar ())
 >       childs <- takeMVar children
 >       putMVar children (mvar:childs)
+>       forkIO (io `finally` putMVar mvar ())
 >
 >     main =
 >      later waitForChildren $