summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2014-09-25 23:10:18 -0500
committerAustin Seipp <austin@well-typed.com>2014-09-25 23:10:19 -0500
commitdc1fce13633e44c6068eb76fc7ed48e94feb5e32 (patch)
treed7e0bffca149317e50f01e60f20bf3b76b6837bd /libraries
parentefdf4b9d69d7eda83f872cbcfac9ef1215f39b7c (diff)
downloadhaskell-dc1fce13633e44c6068eb76fc7ed48e94feb5e32.tar.gz
Refer to 'mask' instead of 'block' in Control.Exception
Summary: More thorough version of a75383cdd46f7bb593639bc6d1628b068b78262a Test Plan: change of comments only [skip ci] Reviewers: austin, simonmar, ekmett Reviewed By: austin, ekmett Subscribers: simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D239
Diffstat (limited to 'libraries')
-rw-r--r--libraries/base/Control/Exception.hs8
-rw-r--r--libraries/base/GHC/IO.hs5
2 files changed, 7 insertions, 6 deletions
diff --git a/libraries/base/Control/Exception.hs b/libraries/base/Control/Exception.hs
index 252597d70e..fa505750f2 100644
--- a/libraries/base/Control/Exception.hs
+++ b/libraries/base/Control/Exception.hs
@@ -190,11 +190,11 @@ use:
case use 'catch' or 'catchJust'.
The difference between using 'try' and 'catch' for recovery is that in
-'catch' the handler is inside an implicit 'block' (see \"Asynchronous
+'catch' the handler is inside an implicit 'mask' (see \"Asynchronous
Exceptions\") which is important when catching asynchronous
exceptions, but when catching other kinds of exception it is
unnecessary. Furthermore it is possible to accidentally stay inside
-the implicit 'block' by tail-calling rather than returning from the
+the implicit 'mask' by tail-calling rather than returning from the
handler, which is why we recommend using 'try' rather than 'catch' for
ordinary exception recovery.
@@ -210,7 +210,7 @@ A typical use of 'tryJust' for recovery looks like this:
-- -----------------------------------------------------------------------------
-- Asynchronous exceptions
--- | When invoked inside 'mask', this function allows a blocked
+-- | When invoked inside 'mask', this function allows a masked
-- asynchronous exception to be raised, if one exists. It is
-- equivalent to performing an interruptible operation (see
-- #interruptible#), but does not involve any actual blocking.
@@ -258,7 +258,7 @@ to write something like
> catch (restore (...))
> (\e -> handler)
-If you need to unblock asynchronous exceptions again in the exception
+If you need to unmask asynchronous exceptions again in the exception
handler, 'restore' can be used there too.
Note that 'try' and friends /do not/ have a similar default, because
diff --git a/libraries/base/GHC/IO.hs b/libraries/base/GHC/IO.hs
index 66e4bfb303..62c4975c37 100644
--- a/libraries/base/GHC/IO.hs
+++ b/libraries/base/GHC/IO.hs
@@ -402,8 +402,9 @@ onException io what = io `catchException` \e -> do _ <- what
-- state if the masked thread /blocks/ in certain ways; see
-- "Control.Exception#interruptible".
--
--- Threads created by 'Control.Concurrent.forkIO' inherit the masked
--- state from the parent; that is, to start a thread in blocked mode,
+-- Threads created by 'Control.Concurrent.forkIO' inherit the
+-- 'MaskingState' from the parent; that is, to start a thread in the
+-- 'MaskedInterruptible' state,
-- use @mask_ $ forkIO ...@. This is particularly useful if you need
-- to establish an exception handler in the forked thread before any
-- asynchronous exceptions are received. To create a a new thread in