Commit 0233f2a2 authored by Simon Marlow's avatar Simon Marlow

make this test more reliable, and enable threaded2

parent f44573e7
......@@ -84,7 +84,7 @@ test('ffi012', skip_if_not_windows, compile_and_run, [''])
test('ffi013', expect_fail_for(['extcore','optextcore']), compile_and_run, [''])
# threaded2 sometimes gives ffi014: Main_dDu: interrupted
test('ffi014', only_ways(['threaded1']), compile_and_run, ['ffi014_cbits.c'])
test('ffi014', only_ways(['threaded1','threaded2']), compile_and_run, ['ffi014_cbits.c'])
# GHCi can't handle the separate C file (ToDo: fix this somehow)
test('ffi015', [ omit_ways(['ghci']), extra_clean(['ffi015_cbits.o']) ],
......
......@@ -7,7 +7,13 @@ import Control.Monad
import Foreign.Ptr
import Data.IORef
main = replicateM 100 (putStrLn "." >> forkOS thread >> thread)
main = do
ms <- replicateM 100 $ do putStrLn "."
m <- newEmptyMVar
forkOS (thread >> putMVar m ())
thread
return m
mapM takeMVar ms
thread = do var <- newIORef 0
let f = modifyIORef var (1+)
......
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