[commit: testsuite] master: The "unblock" was important here (3663f98)

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


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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/3663f98c24192a8f6dcbdf225de8f9ffcfa7dd23

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

commit 3663f98c24192a8f6dcbdf225de8f9ffcfa7dd23
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Wed Feb 20 09:26:27 2013 +0000

    The "unblock" was important here
    
    Because catch implicitly masks the exception handler.

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

 tests/concurrent/should_run/throwto003.hs |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/concurrent/should_run/throwto003.hs b/tests/concurrent/should_run/throwto003.hs
index 8f62fb3..37540cc 100644
--- a/tests/concurrent/should_run/throwto003.hs
+++ b/tests/concurrent/should_run/throwto003.hs
@@ -5,12 +5,12 @@ import Control.Monad
 
 main = do
   m <- newMVar 1
-  t1 <- forkIO $ thread m
+  t1 <- mask $ \restore -> forkIO $ thread restore m
   t2 <- forkIO $ forever $ killThread t1
   threadDelay 1000000
   takeMVar m
 
-thread m = run
+thread restore m = run
   where 
-    run = (forever $ modifyMVar_ m $ \v -> if v `mod` 2 == 1 then return (v*2) else return (v-1))
+    run = (restore $ forever $ modifyMVar_ m $ \v -> if v `mod` 2 == 1 then return (v*2) else return (v-1))
              `catch` \(e::SomeException) -> run





More information about the ghc-commits mailing list