slave-thread 1.1 → 1.1.0.1
raw patch · 2 files changed
+11/−2 lines, 2 filesdep ~stm-containers
Dependency ranges changed: stm-containers
Files
- library/SlaveThread.hs +9/−0
- slave-thread.cabal +2/−2
library/SlaveThread.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} -- | -- Vanilla thread management in Haskell is low level and -- it does not approach the problems related to thread deaths.@@ -143,13 +144,21 @@ killSlaves :: ThreadId -> IO () killSlaves thread = do+#if MIN_VERSION_stm_containers(1,2,0)+ threads <- atomically (UnfoldlM.foldM (Foldl.generalize Foldl.revList) (Multimap.unfoldlMByKey thread slaveRegistry))+#else threads <- atomically (UnfoldlM.foldM (Foldl.generalize Foldl.revList) (Multimap.unfoldMByKey thread slaveRegistry))+#endif traverse_ killThread threads waitForSlavesToDie :: ThreadId -> IO () waitForSlavesToDie thread = atomically $ do+#if MIN_VERSION_stm_containers(1,2,0)+ null <- UnfoldlM.null $ Multimap.unfoldlMByKey thread slaveRegistry+#else null <- UnfoldlM.null $ Multimap.unfoldMByKey thread slaveRegistry+#endif unless null retry -- | A slave thread crashed. This exception is classified as /asynchronous/,
slave-thread.cabal view
@@ -1,5 +1,5 @@ name: slave-thread-version: 1.1+version: 1.1.0.1 synopsis: A fundamental solution to ghost threads and silent exceptions description: Vanilla thread management in Haskell is low level and @@ -62,7 +62,7 @@ deferred-folds >=0.9 && <0.10, focus >=1 && <1.1, foldl >=1 && <2,- stm-containers >=1.1 && <1.2+ stm-containers >=1.1 && <1.3 test-suite test type: exitcode-stdio-1.0