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

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