New asynchronous exception control API (base parts)
authorSimon Marlow <marlowsd@gmail.com>
Thu, 8 Jul 2010 15:27:35 +0000 (15:27 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 8 Jul 2010 15:27:35 +0000 (15:27 +0000)
commit73157075b708095b14a8551ca2f296a8b4f2550b
treeb38aa88732e04ebf6e859423ed5f3a592a3313f9
parent3ae2fa064d02837651c305f2e8815e5e1e614029
 New asynchronous exception control API (base parts)

As discussed on the libraries/haskell-cafe mailing lists
  http://www.haskell.org/pipermail/libraries/2010-April/013420.html

This is a replacement for block/unblock in the asychronous exceptions
API to fix a problem whereby a function could unblock asynchronous
exceptions even if called within a blocked context.

The new terminology is "mask" rather than "block" (to avoid confusion
due to overloaded meanings of the latter).

The following is the new API; the old API is deprecated but still
available for the time being.

Control.Exception
-----------------

mask  :: ((forall a. IO a -> IO a) -> IO b) -> IO b
mask_ :: IO a -> IO a

uninterruptibleMask :: ((forall a. IO a -> IO a) -> IO b) -> IO b
uninterruptibleMask_ :: IO a -> IO

getMaskingState :: IO MaskingState

data MaskingState
  = Unmasked
  | MaskedInterruptible
  | MaskedUninterruptible

Control.Concurrent
------------------

forkIOUnmasked :: IO () -> IO ThreadId
14 files changed:
libraries/base/Control/Concurrent.hs
libraries/base/Control/Concurrent/MVar.hs
libraries/base/Control/Concurrent/QSem.hs
libraries/base/Control/Concurrent/QSemN.hs
libraries/base/Control/Concurrent/SampleVar.hs
libraries/base/Control/Exception.hs
libraries/base/Control/Exception/Base.hs
libraries/base/Control/OldException.hs
libraries/base/Data/HashTable.hs
libraries/base/Data/Typeable.hs
libraries/base/Foreign/Marshal/Pool.hs
libraries/base/GHC/Conc.lhs
libraries/base/GHC/IO.hs
libraries/base/GHC/IO/Handle/Internals.hs