summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-02-19 18:50:49 +0000
committerIan Lynagh <ian@well-typed.com>2013-02-19 18:50:49 +0000
commit52ea416f016e214b8421ad3db3c5049fa93dd574 (patch)
tree909c9ffadc4a4ee38fca97339c523e0d654dad67
parent06596cf1bd6c0750bad4ec80867ef3909e88899f (diff)
downloadhaskell-52ea416f016e214b8421ad3db3c5049fa93dd574.tar.gz
Update a few more tests to use mask rather than block/unblock
-rw-r--r--testsuite/tests/concurrent/should_run/conc069.hs4
-rw-r--r--testsuite/tests/concurrent/should_run/throwto002.hs10
-rw-r--r--testsuite/tests/concurrent/should_run/throwto003.hs2
3 files changed, 8 insertions, 8 deletions
diff --git a/testsuite/tests/concurrent/should_run/conc069.hs b/testsuite/tests/concurrent/should_run/conc069.hs
index fd757133a5..d2947a2b10 100644
--- a/testsuite/tests/concurrent/should_run/conc069.hs
+++ b/testsuite/tests/concurrent/should_run/conc069.hs
@@ -6,11 +6,11 @@ main = do
m <- newEmptyMVar
forkIO (do stat; putMVar m ())
takeMVar m
- block $ forkIO (do stat; putMVar m ())
+ mask $ \_ -> forkIO (do stat; putMVar m ())
takeMVar m
forkOS (do stat; putMVar m ())
takeMVar m
- block $ forkOS (do stat; putMVar m ())
+ mask $ \_ -> forkOS (do stat; putMVar m ())
takeMVar m
stat = do
diff --git a/testsuite/tests/concurrent/should_run/throwto002.hs b/testsuite/tests/concurrent/should_run/throwto002.hs
index db67c24df7..e7fcc36012 100644
--- a/testsuite/tests/concurrent/should_run/throwto002.hs
+++ b/testsuite/tests/concurrent/should_run/throwto002.hs
@@ -11,14 +11,14 @@ import Data.IORef
main = do
r <- newIORef 0
rec
- t1 <- block $ forkIO (thread r t2)
- t2 <- block $ forkIO (thread r t1)
+ t1 <- mask $ \restore -> forkIO (thread restore r t2)
+ t2 <- mask $ \restore -> forkIO (thread restore r t1)
threadDelay 1000000
readIORef r >>= print . (/= 0)
-thread r t = run
- where
- run = (unblock $ forever $ do killThread t
+thread restore r t = run
+ where
+ run = (restore $ forever $ do killThread t
i <- atomicModifyIORef r (\i -> (i + 1, i))
evaluate i)
`catch` \(e::SomeException) -> run
diff --git a/testsuite/tests/concurrent/should_run/throwto003.hs b/testsuite/tests/concurrent/should_run/throwto003.hs
index 7a7582f561..8f62fb30da 100644
--- a/testsuite/tests/concurrent/should_run/throwto003.hs
+++ b/testsuite/tests/concurrent/should_run/throwto003.hs
@@ -12,5 +12,5 @@ main = do
thread m = run
where
- run = (unblock $ forever $ modifyMVar_ m $ \v -> if v `mod` 2 == 1 then return (v*2) else return (v-1))
+ run = (forever $ modifyMVar_ m $ \v -> if v `mod` 2 == 1 then return (v*2) else return (v-1))
`catch` \(e::SomeException) -> run