diff options
author | Simon Marlow <marlowsd@gmail.com> | 2013-02-20 09:19:54 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2013-02-20 09:19:54 +0000 |
commit | dcbd5a50d93dac85f9b0ac69e0077a867e6800ea (patch) | |
tree | a02cbbe63b967cc282cfc90f80445ef6678b49db /testsuite/tests/concurrent | |
parent | 5e10b984310ca1136be29845695742a64f55cfaa (diff) | |
download | haskell-dcbd5a50d93dac85f9b0ac69e0077a867e6800ea.tar.gz |
use unsafeUnmask instead of an IORef containing restore
This is much closer to how the test originally worked, so it's more
likely that the test is still testing what it was testing before :-)
Diffstat (limited to 'testsuite/tests/concurrent')
-rw-r--r-- | testsuite/tests/concurrent/should_run/T3279.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/testsuite/tests/concurrent/should_run/T3279.hs b/testsuite/tests/concurrent/should_run/T3279.hs index f479704310..a90d38aaa4 100644 --- a/testsuite/tests/concurrent/should_run/T3279.hs +++ b/testsuite/tests/concurrent/should_run/T3279.hs @@ -3,19 +3,20 @@ import System.IO.Unsafe import GHC.Conc import Control.Exception +import GHC.IO (unsafeUnmask) f :: Int f = (1 +) . unsafePerformIO $ do error "foo" `catch` \(SomeException e) -> do myThreadId >>= flip throwTo e -- point X - unblock $ return 1 + unsafeUnmask $ return 1 main :: IO () main = do evaluate f `catch` \(SomeException e) -> return 0 -- the evaluation of 'x' is now suspended at point X - tid <- block $ forkIO (evaluate f >> return ()) + tid <- mask_ $ forkIO (evaluate f >> return ()) killThread tid -- now execute the 'unblock' above with a pending exception yield |