blob: 71ad2aca70adc647c816ffd74564232b2554b64c (
plain)
1
2
3
4
5
6
7
8
9
10
|
import Control.Concurrent
import Control.Exception
main = do
m <- newEmptyMVar
t <- forkIO (mask_ $ takeMVar m)
threadDelay 100000
throwTo t (ErrorCall "I'm Interruptible")
threadDelay 100000
putMVar m () -- to avoid t being garbage collected
|