[project @ 2001-02-13 15:12:42 by rrt]
[ghc-hetmet.git] / ghc / tests / concurrent / should_run / conc024.hs
1 module Main where
2
3 import Exception
4 import Concurrent
5 import Prelude hiding (catch)
6
7 -- illustrates the BlockOnDeadMVar exception
8
9 main = do
10   id <- myThreadId
11   forkIO (catch (do m <- newEmptyMVar; takeMVar m)
12                 (\e -> throwTo id e))
13   catch (print (sum [1..1000000]))
14         (\e -> print e)