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)
commit4c29f6f110d23b890567b8696a964bb212eba52e
treecf14200030e04c4c2f38de55d69e3a57c364c025
parent1127922b72ce9f2e57dd4e77e303be6804ae9c3a
 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:
Control/Concurrent.hs
Control/Concurrent/MVar.hs
Control/Concurrent/QSem.hs
Control/Concurrent/QSemN.hs
Control/Concurrent/SampleVar.hs
Control/Exception.hs
Control/Exception/Base.hs
Control/OldException.hs
Data/HashTable.hs
Data/Typeable.hs
Foreign/Marshal/Pool.hs
GHC/Conc.lhs
GHC/IO.hs
GHC/IO/Handle/Internals.hs