[project @ 2000-08-15 14:12:18 by simonmar]
authorsimonmar <unknown>
Tue, 15 Aug 2000 14:12:18 +0000 (14:12 +0000)
committersimonmar <unknown>
Tue, 15 Aug 2000 14:12:18 +0000 (14:12 +0000)
this test had random end conditions; make it a bit more deterministic

ghc/tests/concurrent/should_run/conc005.hs

index 5cbcca7..ba7d2ad 100644 (file)
@@ -6,11 +6,12 @@ import Concurrent
 
 main = do
   v <- newCVar
+  done <- newEmptyMVar
   let
        reader = do
            c <- readCVar v
            if (c == '\n') 
-               then return () 
+               then putMVar done ()
                else do putChar c; reader
 
        writer []     = do writeCVar v '\n'; return ()
@@ -18,4 +19,5 @@ main = do
 
   forkIO reader
   writer "Hello World"
+  takeMVar done