summaryrefslogtreecommitdiff
path: root/testsuite/tests/concurrent/should_run/conc019.hs
blob: 51b3d7563ab6bcb78b04c50d6036a8f2d3408459 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import Control.Concurrent
import Control.Exception
import Data.List
import System.Mem

-- !!! test that a child thread waiting on its own MVar will get killed by
-- a signal.

main = do
  forkIO (Control.Exception.catch (do { m <- newEmptyMVar; takeMVar m })
		$ \e -> putStrLn ("caught: " ++ show (e::SomeException)))
  threadDelay 10000
  System.Mem.performGC
  threadDelay 10000