blob: eb90d065915595c75d442f062080cf73eda62498 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
import Control.Concurrent
import Control.Exception
import GHC.Conc
-- test forkBlockIO
main = do
main_thread <- myThreadId
m <- newEmptyMVar
sub_thread <- block $ forkIO $
sum [1..100000] `seq`
throwTo main_thread (ErrorCall "foo")
killThread sub_thread
putStrLn "oops"
|