Skip to content

Commit

Permalink
Add a test for shutting down a process with in-calls in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmar committed May 10, 2013
1 parent 48dc03b commit 640750a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/rts/all.T
Expand Up @@ -169,3 +169,7 @@ test('stablename001', expect_fail_for(['hpc']), compile_and_run, [''])
test('T7815', [ multi_cpu_race,
extra_run_opts('50000 +RTS -N2 -RTS'),
only_ways(['threaded1', 'threaded2']) ], compile_and_run, [''] )

# ignore_output because it contains a unique:
# ffishutdown: Main_dul: interrupted
test('ffishutdown', [ ignore_output, only_ways(['threaded1','threaded2']) ], compile_and_run, [''])
13 changes: 13 additions & 0 deletions tests/rts/ffishutdown.hs
@@ -0,0 +1,13 @@
import Control.Concurrent
import Control.Monad
import Foreign.Ptr

main = do
fptr <- wrap $ return . (*4)
forkIO $ forever $ do
_ <- dyn fptr 4
return ()
threadDelay $ 100 * 1000

foreign import ccall "wrapper" wrap :: (Double -> IO Double) -> IO (FunPtr (Double -> IO Double))
foreign import ccall "dynamic" dyn :: FunPtr (Double -> IO Double) -> Double -> IO Double
1 change: 1 addition & 0 deletions tests/rts/ffishutdown.stderr
@@ -0,0 +1 @@
ffishutdown: Main_dui: interrupted

0 comments on commit 640750a

Please sign in to comment.