Commit 72e3be2a authored by Simon Marlow's avatar Simon Marlow
Browse files

improve conc039 a little bit, and omit it for threaded1

parent 51346192
......@@ -90,9 +90,9 @@ test('conc037', only_ways(['threaded1','threaded2']), compile_and_run, [''])
test('conc038', only_ways(['threaded1','threaded2']), compile_and_run, [''])
# Omit for GHCi, uses foreign export
# Omit for SMP (threaded2), because in this case the main thread is allowed to
# Omit for the threaded ways, because in this case the main thread is allowed to
# complete, which causes the child thread to be interrupted.
test('conc039', omit_ways(['ghci','threaded2']), compile_and_run, [''])
test('conc039', omit_ways(['ghci','threaded1','threaded2']), compile_and_run, [''])
# Omit for GHCi, uses foreign export
test('conc040', compose(only_compiler_types(['ghc']),
......
......@@ -5,13 +5,16 @@ import System.Mem
import Control.Concurrent
foreign export ccall "performGC_" performGC' :: IO ()
performGC' = do yield; performGC
performGC' = do putMVar m (); yield; performGC
foreign import ccall "performGC_" f :: IO ()
{-# NOINLINE m #-}
m = unsafePerformIO newEmptyMVar
main = do
forkIO f
yield
takeMVar m
-- This tests for a bug in the garbage collector, whereby a main
-- thread that has completed may be GC'd before its return value is
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment