threads 0.5.1.6 → 0.5.1.7
raw patch · 3 files changed
+17/−6 lines, 3 filesdep ~basenew-uploaderPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- Control/Concurrent/Raw.hs +9/−1
- test/test.hs +2/−2
- threads.cabal +6/−3
Control/Concurrent/Raw.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples #-}+{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, UnboxedTuples #-} module Control.Concurrent.Raw ( rawForkIO, rawForkOn ) where @@ -12,10 +12,18 @@ -- exception handler. {-# INLINE rawForkIO #-} rawForkIO :: IO () -> IO ThreadId+#if MIN_VERSION_base(4,17,0)+rawForkIO (IO action) = IO $ \s ->+#else rawForkIO action = IO $ \s ->+#endif case (fork# action s) of (# s1, tid #) -> (# s1, ThreadId tid #) {-# INLINE rawForkOn #-} rawForkOn :: Int -> IO () -> IO ThreadId+#if MIN_VERSION_base(4,17,0)+rawForkOn (I# cpu) (IO action) = IO $ \s ->+#else rawForkOn (I# cpu) action = IO $ \s ->+#endif case (forkOn# cpu action s) of (# s1, tid #) -> (# s1, ThreadId tid #)
test/test.hs view
@@ -205,10 +205,10 @@ wrapOn_0 = wrap $ ThreadGroup.forkOn 0 wrapIOWithUnmask :: (Fork a -> IO b) -> IO b-wrapIOWithUnmask = wrap $ \tg m -> ThreadGroup.forkIOWithUnmask tg $ const m+wrapIOWithUnmask = wrap $ \tg m -> ThreadGroup.forkIOWithUnmask tg (\_ -> m) wrapOnWithUnmask :: (Fork a -> IO b) -> IO b-wrapOnWithUnmask = wrap $ \tg m -> ThreadGroup.forkOnWithUnmask 0 tg $ const m+wrapOnWithUnmask = wrap $ \tg m -> ThreadGroup.forkOnWithUnmask 0 tg (\_ -> m) wrap :: (ThreadGroup -> Fork a) -> (Fork a -> IO b) -> IO b wrap doFork test = ThreadGroup.new >>= test . doFork
threads.cabal view
@@ -1,5 +1,5 @@ name: threads-version: 0.5.1.6+version: 0.5.1.7 cabal-version: >= 1.9.2 build-type: Custom stability: experimental@@ -44,18 +44,20 @@ GHC==7.6.3, GHC==7.8.4, GHC==7.10.2,- GHC==8.0.1+ GHC==8.0.1,+ GHC==9.4.1 source-repository head Type: git Location: git://github.com/basvandijk/threads.git custom-setup- setup-depends: base >= 4.4 && < 5, Cabal >= 1.12+ setup-depends: base >= 4.4 && < 5, Cabal >= 1.12 && < 3.9 ------------------------------------------------------------------------------- library+ default-language: Haskell2010 build-depends: base >= 4.4 && < 5 , stm >= 2.1 exposed-modules: Control.Concurrent.Thread@@ -66,6 +68,7 @@ ------------------------------------------------------------------------------- test-suite test-threads+ default-language: Haskell2010 type: exitcode-stdio-1.0 hs-source-dirs: test main-is: test.hs