summaryrefslogtreecommitdiff
path: root/testsuite/tests/concurrent/should_run/conc030.hs
blob: b2f439cafeeb41a8ab1b2c93a2989d18a49e9319 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# LANGUAGE CPP #-}
module Main where

import Control.Exception
import Control.Concurrent

-- 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])