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

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