diff options
| author | Gregory P. Smith <greg@mad-scientist.com> | 2008-01-22 01:29:11 (GMT) |
|---|---|---|
| committer | Gregory P. Smith <greg@mad-scientist.com> | 2008-01-22 01:29:11 (GMT) |
| commit | 8f034d9af2c36cd3451fac5044a700da77a96bd5 (patch) | |
| tree | 5121fecd95c73f4e204b7aa6122b7ceafa7110a3 /Lib/threading.py | |
| parent | 9f26fcce04e8347bef539dcdbc51ad40a56fca18 (diff) | |
| download | cpython-8f034d9af2c36cd3451fac5044a700da77a96bd5.zip cpython-8f034d9af2c36cd3451fac5044a700da77a96bd5.tar.gz cpython-8f034d9af2c36cd3451fac5044a700da77a96bd5.tar.bz2 | |
Backport of r60190:
- Fix Issue #1703448: A joined thread could show up in the
threading.enumerate() list after the join() for a brief period until
it actually exited.
Diffstat (limited to 'Lib/threading.py')
| -rw-r--r-- | Lib/threading.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Lib/threading.py b/Lib/threading.py index 7b07265..bab3b42 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -524,11 +524,17 @@ class Thread(_Verbose): if __debug__: self._note("%s.__bootstrap(): normal return", self) finally: - self.__stop() + _active_limbo_lock.acquire() try: - self.__delete() - except: - pass + self.__stop() + try: + # We don't call self.__delete() because it also + # grabs _active_limbo_lock. + del _active[_get_ident()] + except: + pass + finally: + _active_limbo_lock.release() def __stop(self): self.__block.acquire() |
