[commit: testsuite] master: use unsafeUnmask instead of an IORef containing restore (6272664)
Simon Marlow
marlowsd at gmail.com
Wed Feb 20 12:57:10 CET 2013
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/6272664b9c33ba9b9ac5bdf0c120413266716995
>---------------------------------------------------------------
commit 6272664b9c33ba9b9ac5bdf0c120413266716995
Author: Simon Marlow <marlowsd at gmail.com>
Date: Wed Feb 20 09:19:54 2013 +0000
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 :-)
>---------------------------------------------------------------
tests/concurrent/should_run/T3279.hs | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/concurrent/should_run/T3279.hs b/tests/concurrent/should_run/T3279.hs
index f479704..a90d38a 100644
--- a/tests/concurrent/should_run/T3279.hs
+++ b/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
More information about the ghc-commits
mailing list