summaryrefslogtreecommitdiff
path: root/testsuite/tests/concurrent/should_run/conc024.hs
blob: e37d64a6e28e1974606952ee2e65f43b029821dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Main where

import Control.Exception
import Control.Concurrent
import Prelude hiding (catch)
import System.Mem

-- illustrates the BlockOnDeadMVar exception

main = do
  id <- myThreadId
  forkIO (catch (do m <- newEmptyMVar; takeMVar m)
		(\e -> throwTo id (e::SomeException)))
  catch (do yield; performGC; threadDelay 1000000)
	(\e -> print (e::SomeException))