diff options
author | Tim Peters <tim@python.org> | 2013-10-26 03:33:52 (GMT) |
---|---|---|
committer | Tim Peters <tim@python.org> | 2013-10-26 03:33:52 (GMT) |
commit | 7bad39f1749a0fe1d916e9870c0ce5efe9bec690 (patch) | |
tree | 907aaf7925d3ed516ac11e639baf4e225d81a667 /Lib | |
parent | e5bb0bf04ded8ab623da08164c43059d3c68bd87 (diff) | |
download | cpython-7bad39f1749a0fe1d916e9870c0ce5efe9bec690.zip cpython-7bad39f1749a0fe1d916e9870c0ce5efe9bec690.tar.gz cpython-7bad39f1749a0fe1d916e9870c0ce5efe9bec690.tar.bz2 |
Fiddled Thread.join() to be a little simpler. Kinda ;-)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/threading.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/threading.py b/Lib/threading.py index 0c92ab1..5d454b6 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -1059,10 +1059,10 @@ class Thread: if timeout is None: self._wait_for_tstate_lock() - elif timeout >= 0: - self._wait_for_tstate_lock(timeout=timeout) - # else it's a negative timeout - precise behavior isn't documented - # then, but historically .join() returned in this case + else: + # the behavior of a negative timeout isn't documented, but + # historically .join() has acted as if timeout=0 then + self._wait_for_tstate_lock(timeout=max(timeout, 0)) def _wait_for_tstate_lock(self, block=True, timeout=-1): # Issue #18808: wait for the thread state to be gone. |