summaryrefslogtreecommitdiff
path: root/testsuite/tests/concurrent/should_run/conc024.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/concurrent/should_run/conc024.hs')
-rw-r--r--testsuite/tests/concurrent/should_run/conc024.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/concurrent/should_run/conc024.hs b/testsuite/tests/concurrent/should_run/conc024.hs
new file mode 100644
index 0000000000..e37d64a6e2
--- /dev/null
+++ b/testsuite/tests/concurrent/should_run/conc024.hs
@@ -0,0 +1,15 @@
+module Main where
+
+import Control.Exception
+import Control.Concurrent
+import Prelude hiding (catch)
+import System.Mem
+
+-- illustrates the BlockOnDeadMVar exception
+
+main = do
+ id <- myThreadId
+ forkIO (catch (do m <- newEmptyMVar; takeMVar m)
+ (\e -> throwTo id (e::SomeException)))
+ catch (do yield; performGC; threadDelay 1000000)
+ (\e -> print (e::SomeException))