summaryrefslogtreecommitdiffstats
path: root/Lib/threading.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-10-28 09:03:20 (GMT)
committerGeorg Brandl <georg@python.org>2010-10-28 09:03:20 (GMT)
commitb9a439175451903ab77c71e5b2020dbd1671a77e (patch)
tree05f4e3a27501d29451a57b753c75da6e3e3f9794 /Lib/threading.py
parentcbb9421347c97b5a443b260118931962783d4efc (diff)
downloadcpython-b9a439175451903ab77c71e5b2020dbd1671a77e.zip
cpython-b9a439175451903ab77c71e5b2020dbd1671a77e.tar.gz
cpython-b9a439175451903ab77c71e5b2020dbd1671a77e.tar.bz2
#10218: return timeout status from Condition.wait, mirroring other primitives' behavior.
Diffstat (limited to 'Lib/threading.py')
-rw-r--r--Lib/threading.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/threading.py b/Lib/threading.py
index dd6e91d..238a5c4 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -232,6 +232,7 @@ class _Condition(_Verbose):
try: # restore state no matter what (e.g., KeyboardInterrupt)
if timeout is None:
waiter.acquire()
+ gotit = True
if __debug__:
self._note("%s.wait(): got it", self)
else:
@@ -249,6 +250,7 @@ class _Condition(_Verbose):
else:
if __debug__:
self._note("%s.wait(%s): got it", self, timeout)
+ return gotit
finally:
self._acquire_restore(saved_state)