summaryrefslogtreecommitdiff
path: root/testsuite/tests/concurrent/should_run/conc058.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/concurrent/should_run/conc058.hs')
-rw-r--r--testsuite/tests/concurrent/should_run/conc058.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/concurrent/should_run/conc058.hs b/testsuite/tests/concurrent/should_run/conc058.hs
new file mode 100644
index 0000000000..5fbe4e5af8
--- /dev/null
+++ b/testsuite/tests/concurrent/should_run/conc058.hs
@@ -0,0 +1,13 @@
+import Control.Concurrent
+import Control.Exception
+
+-- variation on conc020 that tests for threadDelay being interruptible.
+-- On Windows, with the threaded RTS, in 6.6 and earlier, threadDelay is
+-- not interruptible.
+main = do
+ m <- newEmptyMVar
+ t <- forkIO (block $ threadDelay 1000000)
+ threadDelay 100000
+ throwTo t (ErrorCall "I'm Interruptible")
+ threadDelay 100000
+ putMVar m () -- to avoid t being garbage collected