[project @ 2001-03-08 13:41:31 by simonmar]
authorsimonmar <unknown>
Thu, 8 Mar 2001 13:41:31 +0000 (13:41 +0000)
committersimonmar <unknown>
Thu, 8 Mar 2001 13:41:31 +0000 (13:41 +0000)
update for blocking putMVar

ghc/tests/concurrent/should_run/conc018.hs

index 6ffe887..34894e1 100644 (file)
@@ -1,10 +1,16 @@
 import Concurrent
 import Exception
 
+-- test that putMVar blocks on a full MVar rather than raising an
+-- exception.
+
 main = do
-  Exception.catch (do
-       m <- newMVar ()
-       putMVar m ()
-     )
-     (\e -> print e)
+  t <- forkIO (
+           Exception.catch (do
+               m <- newMVar ()
+               putMVar m ()
+            )
+            (\e -> print e)
+          )
+  threadDelay 500000
+  killThread t