summaryrefslogtreecommitdiff
path: root/testsuite/tests/concurrent/should_run/conc065.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/concurrent/should_run/conc065.hs')
-rw-r--r--testsuite/tests/concurrent/should_run/conc065.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/concurrent/should_run/conc065.hs b/testsuite/tests/concurrent/should_run/conc065.hs
new file mode 100644
index 0000000000..db6d7cf3ba
--- /dev/null
+++ b/testsuite/tests/concurrent/should_run/conc065.hs
@@ -0,0 +1,13 @@
+-- Test for bug #1047
+
+import Control.Concurrent
+import Control.Exception
+
+-- This loop spends most of its time printing stuff, and very occasionally
+-- pops outside 'block'. This test ensures that an thread trying to
+-- throwTo this thread will eventually succeed.
+loop = block (print "alive") >> loop
+
+main = do tid <- forkIO loop
+ threadDelay 1
+ killThread tid