]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-34819: Use a monotonic clock to compute timeouts in concurrent.futures (GH-9599)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 27 Sep 2018 11:46:38 +0000 (04:46 -0700)
committerGitHub <noreply@github.com>
Thu, 27 Sep 2018 11:46:38 +0000 (04:46 -0700)
commit2b01121fd4200f1c27873422f7f72d02eec08630
tree363f27c052fad3e679be4eeae0d059cb8517f2a2
parent2bdba6b4290d9282d88d1df9166aa287f6a211fe
bpo-34819: Use a monotonic clock to compute timeouts in concurrent.futures (GH-9599)

Use a monotonic clock to compute timeouts in :meth:`Executor.map` and :func:`as_completed`, in order to prevent timeouts from deviating when the system clock is adjusted.

This may not be sufficient on all systems. On POSIX for example, the actual waiting (e.g. in ``sem_timedwait``) is specified to rely on the CLOCK_REALTIME clock.
(cherry picked from commit a94ee12c26aa8dd7dce01373779df8055aff765b)

Co-authored-by: orlnub123 <orlnub123@gmail.com>
Lib/concurrent/futures/_base.py
Misc/NEWS.d/next/Library/2018-09-27-09-45-00.bpo-34819.9ZaFyO.rst [new file with mode: 0644]