summaryrefslogtreecommitdiff
path: root/testsuite/tests/concurrent/should_run/conc030.hs
blob: 4f01668456919423e6c8bd77804c023252cb9309 (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)

-- the ThreadKilled exception doesn't cause any output by default

main = do
  m <- newEmptyMVar
  id <- forkIO (takeMVar m)
  yield
  killThread id
  putMVar m ()
  print (sum [1..50000])