packages feed

pthread 0.2.0 → 0.2.1

raw patch · 3 files changed

+12/−5 lines, 3 filesdep ~base

Dependency ranges changed: base

Files

CHANGELOG.md view
@@ -4,11 +4,12 @@  The format is based on [Keep a Changelog](http://keepachangelog.com/). -## Unreleased+## [0.2.1] - 2019-06-17  ### Added -### Changed+* Compatibility with ghc-8.6.+* Check for -threaded.  ## [0.2.0] - 2017-11-06 
pthread.cabal view
@@ -1,5 +1,5 @@ name:                pthread-version:             0.2.0+version:             0.2.1 synopsis:            Bindings for the pthread library. homepage:            http://github.com/tweag/pthread license:             BSD3@@ -25,7 +25,7 @@   exposed-modules:     System.Posix.Thread   build-depends:-    base > 4.9.0.0 && < 5,+    base >= 4.9.0.0 && < 5,     generic-deriving >= 1.11   default-language: Haskell2010 
src/System/Posix/Thread.hsc view
@@ -40,6 +40,7 @@ import Control.Exception (Exception, bracket_, throwIO) import Control.Monad (forM_, unless, when) import Data.Monoid (First(..))+import Data.Semigroup (Semigroup(..)) import Foreign.C.Types import Foreign.C.Error (Errno(..), errnoToIOError) import Foreign.Marshal.Alloc (alloca)@@ -67,6 +68,7 @@ create :: IO (Ptr a) -> IO ThreadId create action =     alloca $ \tidPtr -> do+      unless rtsSupportsBoundThreads (error "Use -threaded RTS.")       fptr <- wrap $ \_ -> action       throwIfNonZero_ $ pthread_create tidPtr nullPtr fptr nullPtr       peek tidPtr@@ -88,6 +90,7 @@ createWithAttributes attrs action =     alloca $ \tidPtr ->     alloca $ \attrsPtr -> do+      unless rtsSupportsBoundThreads (error "Use -threaded RTS.")       bracket_         (throwIfNonZero_ $ pthread_attr_init attrsPtr)         (throwIfNonZero_ $ pthread_attr_destroy attrsPtr) $ do@@ -223,9 +226,12 @@   , stackSize :: First CSize   } deriving (Generic, Show) +instance Semigroup AttributesMonoid where+  (<>) = mappenddefault+ instance Monoid AttributesMonoid where   mempty = memptydefault-  mappend = mappenddefault+  mappend = (<>)  monoidFromAttributes :: Attributes -> AttributesMonoid monoidFromAttributes Attributes{..} =