blob: 863820ba4a2803063a7b2b9728c5fa5f2cf2a298 (
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 ())
|