diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-07-06 11:51:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-06 11:51:52 (GMT) |
commit | c2368cbc83ca2bafeaea0e4760be4996046d0444 (patch) | |
tree | e68abf5dc1a0a3299fda6763410cb41a300cda74 /Lib/multiprocessing/queues.py | |
parent | 6f19fc6d5607040ee36153a64a2ed004582af91f (diff) | |
download | cpython-c2368cbc83ca2bafeaea0e4760be4996046d0444.zip cpython-c2368cbc83ca2bafeaea0e4760be4996046d0444.tar.gz cpython-c2368cbc83ca2bafeaea0e4760be4996046d0444.tar.bz2 |
bpo-34054: multiprocessing uses time.monotonic() (GH-8118)
The multiprocessing module now uses the monotonic clock
time.monotonic() instead of the system clock time.time() to implement
timeouts.
Diffstat (limited to 'Lib/multiprocessing/queues.py')
-rw-r--r-- | Lib/multiprocessing/queues.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/multiprocessing/queues.py b/Lib/multiprocessing/queues.py index 715a9b0..88f7d26 100644 --- a/Lib/multiprocessing/queues.py +++ b/Lib/multiprocessing/queues.py @@ -95,12 +95,12 @@ class Queue(object): self._sem.release() else: if block: - deadline = time.time() + timeout + deadline = time.monotonic() + timeout if not self._rlock.acquire(block, timeout): raise Empty try: if block: - timeout = deadline - time.time() + timeout = deadline - time.monotonic() if not self._poll(timeout): raise Empty elif not self._poll(): |