summaryrefslogtreecommitdiff
path: root/testsuite/tests/concurrent/should_run/T5421.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/concurrent/should_run/T5421.hs')
-rw-r--r--testsuite/tests/concurrent/should_run/T5421.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/concurrent/should_run/T5421.hs b/testsuite/tests/concurrent/should_run/T5421.hs
new file mode 100644
index 0000000000..863820ba4a
--- /dev/null
+++ b/testsuite/tests/concurrent/should_run/T5421.hs
@@ -0,0 +1,17 @@
+import Control.Concurrent
+import Control.Monad.Fix
+
+data Client = Client
+ { clientLock :: MVar ()
+ }
+
+main = do
+ mvar <- newMVar ()
+
+ client <- mfix $ \client -> do
+ _ <- forkIO (mainLoop client)
+ threadDelay 200000
+ return (Client mvar)
+ return ()
+
+mainLoop client = withMVar (clientLock client) (\_ -> return ())