packages feed

concurrency 1.10.0.0 → 1.11.0.0

raw patch · 3 files changed

+48/−7 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Control.Monad.Conc.Class: interruptible :: MonadConc m => m a -> m a
+ Control.Monad.Conc.Class: unsafeUnmask :: MonadConc m => m a -> m a

Files

CHANGELOG.rst view
@@ -6,6 +6,21 @@  .. _PVP: https://pvp.haskell.org/ +1.11.0.0 (2020-05-14)+--------------------++* Git: :tag:`concurrency-1.11.0.0`+* Hackage: :hackage:`concurrency-1.11.0.0`++**Contributors:** :u:`mitchellwrosen` (:pull:`319`).++Added+~~~~~++* (:issue:`316`) ``Control.Monad.Conc.Class.unsafeUnmask``.+* ``Control.Monad.Conc.Class.interruptible``.++ 1.10.0.0 (2020-05-10) --------------------- 
Control/Monad/Conc/Class.hs view
@@ -9,7 +9,7 @@  -- | -- Module      : Control.Monad.Conc.Class--- Copyright   : (c) 2016--2019 Michael Walker+-- Copyright   : (c) 2016--2020 Michael Walker -- License     : MIT -- Maintainer  : Michael Walker <mike@barrucadu.co.uk> -- Stability   : experimental@@ -72,6 +72,7 @@   , Ca.mask_   , uninterruptibleMask   , Ca.uninterruptibleMask_+  , interruptible    -- * Mutable State   , newMVar@@ -91,7 +92,7 @@  -- for the class and utilities import           Control.Exception            (AsyncException(ThreadKilled),-                                               Exception, MaskingState,+                                               Exception, MaskingState(..),                                                SomeException) import           Control.Monad.Catch          (MonadCatch, MonadMask,                                                MonadThrow)@@ -110,6 +111,7 @@ import qualified Data.Atomics                 as IO import qualified Data.IORef                   as IO import qualified GHC.Conc                     as IO+import qualified GHC.IO                       as IO  -- for the transformer instances import           Control.Monad.Reader         (ReaderT)@@ -154,7 +156,7 @@ -- Do not be put off by the use of @UndecidableInstances@, it is safe -- here. ----- @since 1.10.0.0+-- @since 1.11.0.0 class ( Monad m       , MonadCatch m, MonadThrow m, MonadMask m       , MonadSTM (STM m)@@ -187,6 +189,7 @@       , atomically       , throwTo       , getMaskingState+      , unsafeUnmask     #-}    -- | The associated 'MonadSTM' for this class.@@ -504,6 +507,11 @@   -- @since 1.10.0.0   getMaskingState :: m MaskingState +  -- | Set the 'MaskingState' for the current thread to 'MaskedUninterruptible'.+  --+  -- @since 1.11.0.0+  unsafeUnmask :: m a -> m a+ ------------------------------------------------------------------------------- -- Utilities @@ -695,6 +703,21 @@ uninterruptibleMask :: MonadConc m => ((forall a. m a -> m a) -> m b) -> m b uninterruptibleMask = Ca.uninterruptibleMask +-- | Allow asynchronous exceptions to be raised even inside 'mask',+-- making the operation interruptible.+--+-- When called outside 'mask', or inside 'uninterruptibleMask', this+-- function has no effect.+--+-- @since 1.11.0.0+interruptible :: MonadConc m => m a -> m a+interruptible act = do+  st <- getMaskingState+  case st of+    Unmasked              -> act+    MaskedInterruptible   -> unsafeUnmask act+    MaskedUninterruptible -> act+ -- Mutable Variables  -- | Create a new @MVar@ containing a value.@@ -793,6 +816,7 @@   newTVarConc         = IO.newTVarIO   readTVarConc        = IO.readTVarIO   getMaskingState     = IO.getMaskingState+  unsafeUnmask        = IO.unsafeUnmask  -- | Label the current thread, if the given label is nonempty. labelMe :: String -> IO ()@@ -840,6 +864,7 @@   forkOnWithUnmaskN n i ma = toIsConc (forkOnWithUnmaskN n i (\umask -> unIsConc $ ma (\mx -> toIsConc (umask $ unIsConc mx))))   forkOSWithUnmask      ma = toIsConc (forkOSWithUnmask      (\umask -> unIsConc $ ma (\mx -> toIsConc (umask $ unIsConc mx))))   forkOSWithUnmaskN n   ma = toIsConc (forkOSWithUnmaskN n   (\umask -> unIsConc $ ma (\mx -> toIsConc (umask $ unIsConc mx))))+  unsafeUnmask          ma = toIsConc (unsafeUnmask (unIsConc ma))    supportsBoundThreads = toIsConc supportsBoundThreads   isCurrentThreadBound = toIsConc isCurrentThreadBound@@ -923,7 +948,8 @@   atomically          = lift . atomically                      ; \   newTVarConc         = lift . newTVarConc                     ; \   readTVarConc        = lift . readTVarConc                    ; \-  getMaskingState     = lift getMaskingState                   }+  getMaskingState     = lift getMaskingState                   ; \+  unsafeUnmask        = liftedF F unsafeUnmask                 }  -- | New threads inherit the reader state of their parent, but do not -- communicate results back.
concurrency.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                concurrency-version:             1.10.0.0+version:             1.11.0.0 synopsis:            Typeclasses, functions, and data types for concurrency and STM.  description:@@ -19,7 +19,7 @@ license-file:        LICENSE author:              Michael Walker maintainer:          mike@barrucadu.co.uk-copyright:           (c) 2016--2019 Michael Walker+copyright:           (c) 2016--2020 Michael Walker category:            Concurrency build-type:          Simple extra-source-files:  README.markdown CHANGELOG.rst@@ -32,7 +32,7 @@ source-repository this   type:     git   location: https://github.com/barrucadu/dejafu.git-  tag:      concurrency-1.10.0.0+  tag:      concurrency-1.11.0.0  library   exposed-modules:     Control.Monad.Conc.Class