summaryrefslogtreecommitdiff
path: root/testsuite/tests/concurrent/should_run/T5421.hs
blob: 2c143013ddf265fadfc68c680257a05ba191dda5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 ())