summaryrefslogtreecommitdiff
path: root/testsuite/tests/concurrent/should_run/conc073.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/concurrent/should_run/conc073.hs')
-rw-r--r--testsuite/tests/concurrent/should_run/conc073.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/concurrent/should_run/conc073.hs b/testsuite/tests/concurrent/should_run/conc073.hs
new file mode 100644
index 0000000000..64d9d998a6
--- /dev/null
+++ b/testsuite/tests/concurrent/should_run/conc073.hs
@@ -0,0 +1,20 @@
+import Control.Exception
+import Control.Concurrent
+
+main = do
+ m1 <- newEmptyMVar
+ m2 <- newEmptyMVar
+ t <- forkIO $ do
+ mask_ $ return ()
+ throwIO (ErrorCall "test") `catch`
+ \e -> do
+ let _ = e::SomeException
+ print =<< getMaskingState
+ putMVar m1 ()
+ takeMVar m2
+ takeMVar m1
+ killThread t
+ -- in GHC 7.2 and earlier this call will deadlock due to bug #4988.
+ -- However, the RTS will resurrect the child thread, and in doing
+ -- so will unblock the main thread, so the main thread doesn't get
+ -- a BlockedIndefinitely exception.