+git-annex (10.20240228) UNRELEASED; urgency=medium
+
+ * Added dependency on unbounded-delays.
+
+ -- Joey Hess <id@joeyh.name> Tue, 27 Feb 2024 13:07:10 -0400
+
git-annex (10.20240227) upstream; urgency=medium
* importfeed: Added --scrape option, which uses yt-dlp to screen scrape
© 2014 Robie Basak <robie@justgohome.co.uk>
License: GPL-3+
-Files: Utility/ThreadScheduler.hs
-Copyright: 2011 Bas van Dijk & Roel van Dijk
- 2012, 2013 Joey Hess <id@joeyh.name>
-License: BSD-2-clause
-
Files: Utility/Attoparsec.hs
Copyright: 2019 Joey Hess <id@joeyh.name>
2007-2015 Bryan O'Sullivan
{- thread scheduling
-
- - Copyright 2012, 2013 Joey Hess <id@joeyh.name>
- - Copyright 2011 Bas van Dijk & Roel van Dijk
+ - Copyright 2012-2024 Joey Hess <id@joeyh.name>
-
- License: BSD-2-clause
-}
import Control.Monad
import Control.Concurrent
+import qualified Control.Concurrent.Thread.Delay as Unbounded
#ifndef mingw32_HOST_OS
import Control.Monad.IfElse
import System.Posix.IO
threadDelaySeconds :: Seconds -> IO ()
threadDelaySeconds (Seconds n) = unboundDelay (fromIntegral n * oneSecond)
-{- Like threadDelay, but not bounded by an Int.
- -
- - There is no guarantee that the thread will be rescheduled promptly when the
- - delay has expired, but the thread will never continue to run earlier than
- - specified.
- -
- - Taken from the unbounded-delay package to avoid a dependency for 4 lines
- - of code.
- -}
+{- Like threadDelay, but not bounded by an Int. -}
unboundDelay :: Microseconds -> IO ()
-unboundDelay time = do
- let maxWait = min time $ toInteger (maxBound :: Int)
- threadDelay $ fromInteger maxWait
- when (maxWait /= time) $ unboundDelay (time - maxWait)
+unboundDelay = Unbounded.delay
{- Pauses the main thread, letting children run until program termination. -}
waitForTermination :: IO ()