blob: 5ee74c6d7cc07d3979581a5cd66114174140e390 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import Control.Concurrent
import Control.Exception
-- variation on conc020 that tests for threadDelay being interruptible.
-- On Windows, with the threaded RTS, in 6.6 and earlier, threadDelay is
-- not interruptible.
main = do
m <- newEmptyMVar
t <- forkIO (mask_ $ threadDelay 1000000)
threadDelay 100000
throwTo t (ErrorCall "I'm Interruptible")
threadDelay 100000
putMVar m () -- to avoid t being garbage collected
|