4 -- check that async exceptions are restored to their previous
5 -- state after an exception is raised and handled.
8 main_thread <- myThreadId
14 throwTo main_thread (ErrorCall "foo")
16 throwTo main_thread (ErrorCall "bar")
23 -- unblocked, "foo" delivered to "caught1"
26 ) `Exception.catch` (\e -> putStrLn ("caught1: " ++ show e))
28 -- blocked here, "bar" can't be delivered
29 (sum [1..10000] `seq` return ())
30 `Exception.catch` (\e -> putStrLn ("caught2: " ++ show e))
32 -- unblocked here, "bar" delivered to "caught3"
35 `Exception.catch` (\e -> putStrLn ("caught3: " ++ show e))