blob: 681eb9586ec112416402ad0e5a31428a8ed521bf (
plain)
1
2
3
4
5
6
7
8
9
10
|
import Control.Concurrent
import Control.Monad (forever)
main = do
empty <- newEmptyMVar
exit <- newEmptyMVar
_ <- forkIO $ threadDelay 200000 >> putMVar exit ()
_ <- forkIO $ takeMVar empty >> return ()
_ <- forkIO $ print (sum [1..10000])
takeMVar exit
|