view MVar.hs @ 2:adc9ccc88192 default tip

add fib
author Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
date Tue, 30 Jul 2013 17:54:19 +0900
parents fa93d5b5b600
children
line wrap: on
line source

import Control.Concurrent

communicate = do
  m <- newEmptyMVar
  forkIO $ do
    v <- takeMVar m
    putStrLn ("received " ++ show v)
  putStrLn "sending"
  putMVar m "wake up"