summaryrefslogtreecommitdiff
path: root/testsuite/tests/profiling/should_run/T11978b.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/profiling/should_run/T11978b.hs')
-rw-r--r--testsuite/tests/profiling/should_run/T11978b.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/profiling/should_run/T11978b.hs b/testsuite/tests/profiling/should_run/T11978b.hs
new file mode 100644
index 0000000000..226e7d1687
--- /dev/null
+++ b/testsuite/tests/profiling/should_run/T11978b.hs
@@ -0,0 +1,22 @@
+
+import Control.Concurrent
+import Control.Concurrent.MVar
+import Control.Exception
+import Control.Monad
+
+main :: IO ()
+main = do
+ putStrLn "Start ..."
+ mvar <- newMVar (0 :: Int)
+
+ let count = 50
+
+ forM_ [ 1 .. count ] $ const $ forkIO $ do
+ threadDelay 100
+ i <- takeMVar mvar
+ putMVar mvar $! i + 1
+
+ threadDelay 1000000
+ end <- takeMVar mvar
+ putStrLn $ "Final result " ++ show end
+ assert (end == count) $ return ()