[project @ 2000-11-10 09:51:45 by simonmar]
authorsimonmar <unknown>
Fri, 10 Nov 2000 09:51:45 +0000 (09:51 +0000)
committersimonmar <unknown>
Fri, 10 Nov 2000 09:51:45 +0000 (09:51 +0000)
Add test illustrating the BlockedOnDeadMVar exception.

ghc/tests/concurrent/should_run/conc024.hs [new file with mode: 0644]
ghc/tests/concurrent/should_run/conc024.stdout [new file with mode: 0644]

diff --git a/ghc/tests/concurrent/should_run/conc024.hs b/ghc/tests/concurrent/should_run/conc024.hs
new file mode 100644 (file)
index 0000000..0daed7e
--- /dev/null
@@ -0,0 +1,14 @@
+module Main where
+
+import Exception
+import Concurrent
+import Prelude hiding (catch)
+
+-- illustrates the BlockOnDeadMVar exception
+
+main = do
+  id <- myThreadId
+  forkIO (catchAllIO (do m <- newEmptyMVar; takeMVar m)
+               (\e -> raiseInThread id e))
+  catchAllIO (print (sum [1..1000000]))
+       (\e -> print e)
diff --git a/ghc/tests/concurrent/should_run/conc024.stdout b/ghc/tests/concurrent/should_run/conc024.stdout
new file mode 100644 (file)
index 0000000..fc393ed
--- /dev/null
@@ -0,0 +1 @@
+thread blocked indefinitely