An interpreted, interactive, object-oriented programming language
CentOS Sources
2017-08-01 71084d584ff953f5463757ec6536406320560b4d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/Lib/threading.py b/Lib/threading.py
index e4c7f35..91b3849 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -351,13 +351,14 @@ class _Condition(_Verbose):
                     gotit = waiter.acquire(0)
                     if gotit:
                         break
-                    remaining = endtime - _time()
+                    remaining = min(endtime - _time(), timeout)
                     if remaining <= 0:
                         break
                     if balancing:
                         delay = min(delay * 2, remaining, 0.05)
                     else:
                         delay = remaining
+                        endtime = _time() + remaining
                     _sleep(delay)
                 if not gotit:
                     if __debug__: