git.iko.soy/distributed-process
on master help sign in
C.D.P.Internal.Primtives.mask does not work correctly if unmask is
878446aJeff Epstein
src/Control/Distributed/Process/Internal/Primitives.hs+5−3
@@ -716,10 +716,12 @@ mask :: ((forall a. Process a -> Process a) -> Process b) -> Process b
716mask p = do
716mask p = do
717 lproc <- ask
717 lproc <- ask
718 liftIO $ Ex.mask $ \restore ->
718 liftIO $ Ex.mask $ \restore ->
719− runLocalProcess lproc (p (liftRestore lproc restore))
719+ runLocalProcess lproc (p (liftRestore restore))
720 where
720 where
721− liftRestore :: LocalProcess -> (forall a. IO a -> IO a) -> (forall a. Process a -> Process a)
721+ liftRestore :: (forall a. IO a -> IO a) -> (forall a. Process a -> Process a)
722+ liftRestore restoreIO = \p2 -> do
723+ llproc <- ask
722− liftRestore lproc restoreIO = liftIO . restoreIO . runLocalProcess lproc
724+ liftIO $ restoreIO $ runLocalProcess llproc p2
723
725
724-- | Lift 'Control.Exception.onException'
726-- | Lift 'Control.Exception.onException'
725onException :: Process a -> Process b -> Process a
727onException :: Process a -> Process b -> Process a