blob: bfadaa85c7fccc36037061bcf4dd887f9ad74cce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import Control.Concurrent
import Control.Exception
import Control.Monad
import System.IO
import System.Environment
-- test for deadlocks
main = do
hSetBuffering stdout NoBuffering
[n] <- getArgs
replicateM_ (read n) $ do
chan <- newChan
wid <- forkIO $ forever $ writeChan chan (5::Int)
threadDelay 3000
throwTo wid ThreadKilled
putStr "."
writeChan chan (3::Int)
|