Blame SOURCES/00257-threading-wait-clamp-remaining-time.patch

71084d
diff --git a/Lib/threading.py b/Lib/threading.py
71084d
index e4c7f35..91b3849 100644
71084d
--- a/Lib/threading.py
71084d
+++ b/Lib/threading.py
71084d
@@ -351,13 +351,14 @@ class _Condition(_Verbose):
71084d
                     gotit = waiter.acquire(0)
71084d
                     if gotit:
71084d
                         break
71084d
-                    remaining = endtime - _time()
71084d
+                    remaining = min(endtime - _time(), timeout)
71084d
                     if remaining <= 0:
71084d
                         break
71084d
                     if balancing:
71084d
                         delay = min(delay * 2, remaining, 0.05)
71084d
                     else:
71084d
                         delay = remaining
71084d
+                        endtime = _time() + remaining
71084d
                     _sleep(delay)
71084d
                 if not gotit:
71084d
                     if __debug__: