summaryrefslogtreecommitdiff
path: root/Utility/Parallel.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-30 11:52:44 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-30 11:52:44 -0400
commit40c997367544d72c6ab55eb96a1c3344fcf4012c (patch)
treed99d43e63d67687496d10859b5e8b8d9c6999f2c /Utility/Parallel.hs
parent3dce75fb23fca94ad86c3f0ee816bb0ad2ecb27c (diff)
fix push status, broken when inParallel was adapted for -threaded
Before pushing ran in its own process, so exitSuccess was the right thing to do, but with the threaded code, that's caught as an exception.
Diffstat (limited to 'Utility/Parallel.hs')
-rw-r--r--Utility/Parallel.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Utility/Parallel.hs b/Utility/Parallel.hs
index fcab2a90a..373a0ece5 100644
--- a/Utility/Parallel.hs
+++ b/Utility/Parallel.hs
@@ -18,7 +18,7 @@ import Control.Exception
-
- Returns the values partitioned into ones with which the action succeeded,
- and ones with which it failed. -}
-inParallel :: (v -> IO ()) -> [v] -> IO ([v], [v])
+inParallel :: (v -> IO Bool) -> [v] -> IO ([v], [v])
inParallel a l = do
mvars <- mapM thread l
statuses <- mapM takeMVar mvars
@@ -28,8 +28,8 @@ inParallel a l = do
thread v = do
mvar <- newEmptyMVar
_ <- forkIO $ do
- r <- try (a v) :: IO (Either SomeException ())
+ r <- try (a v) :: IO (Either SomeException Bool)
case r of
Left _ -> putMVar mvar False
- Right _ -> putMVar mvar True
+ Right b -> putMVar mvar b
return mvar