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

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