summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZubin Duggal <zubin@cmi.ac.in>2021-02-26 02:26:32 +0530
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-02-27 08:00:46 -0500
commitc703cb398f980a1a799a5a7dbee763db12cc5f7f (patch)
tree54baa1b4d05d4842dc69eeba5dc39a5519b4ef98
parent629dd56deedcd1162ef5417a9e446f6f1c2b667a (diff)
downloadhaskell-c703cb398f980a1a799a5a7dbee763db12cc5f7f.tar.gz
Explain uninterruptibleMask
-rw-r--r--compiler/GHC/Data/IOEnv.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/GHC/Data/IOEnv.hs b/compiler/GHC/Data/IOEnv.hs
index c6077d6a94..7035b82b81 100644
--- a/compiler/GHC/Data/IOEnv.hs
+++ b/compiler/GHC/Data/IOEnv.hs
@@ -173,6 +173,7 @@ tryAllM (IOEnv thing) = IOEnv (\ env -> safeTry (thing env))
safeTry :: IO a -> IO (Either SomeException a)
safeTry act = do
var <- newEmptyMVar
+ -- uninterruptible because we want to mask around 'killThread', which is interruptible.
uninterruptibleMask $ \restore -> do
-- Fork, so that 'act' is safe from all asynchronous exceptions other than the ones we send it
t <- forkIO $ try (restore act) >>= putMVar var