[commit: testsuite] master: Revert "Update T3279 to use mask rather than block" (e8a22ac)

Simon Marlow marlowsd at gmail.com
Wed Feb 20 12:57:08 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/e8a22acdd2c43ddb1b3d3a0817abbc017b818601

>---------------------------------------------------------------

commit e8a22acdd2c43ddb1b3d3a0817abbc017b818601
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Wed Feb 20 09:16:52 2013 +0000

    Revert "Update T3279 to use mask rather than block"
    
    This reverts commit a6d80ce5fb2211af8dafc425705fefb316702802.

>---------------------------------------------------------------

 tests/concurrent/should_run/T3279.hs |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/tests/concurrent/should_run/T3279.hs b/tests/concurrent/should_run/T3279.hs
index 46e9b03..f479704 100644
--- a/tests/concurrent/should_run/T3279.hs
+++ b/tests/concurrent/should_run/T3279.hs
@@ -1,30 +1,24 @@
 -- test for #3279
 
-import Data.IORef
 import System.IO.Unsafe
 import GHC.Conc
 import Control.Exception
 
+f :: Int
+f = (1 +) . unsafePerformIO $ do
+        error "foo" `catch` \(SomeException e) -> do
+            myThreadId >>= flip throwTo e
+            -- point X
+            unblock $ return 1
+
 main :: IO ()
 main = do
-    restoreRef <- newIORef id
-
-    let f :: Int
-        f = (1 +) . unsafePerformIO $ do
-                error "foo" `catch` \(SomeException e) -> do
-                    myThreadId >>= flip throwTo e
-                    -- point X
-                    restore <- readIORef restoreRef
-                    restore $ return 1
-
     evaluate f `catch` \(SomeException e) -> return 0
     -- the evaluation of 'x' is now suspended at point X
-    tid <- mask $ \restore -> do writeIORef restoreRef restore
-                                 forkIO (evaluate f >> return ())
+    tid <- block $ forkIO (evaluate f >> return ())
     killThread tid
     -- now execute the 'unblock' above with a pending exception
     yield
-    writeIORef restoreRef id
     -- should print 1 + 1 = 2
     print f
     





More information about the ghc-commits mailing list