mirror of
https://github.com/python/cpython.git
synced 2025-08-20 08:41:07 +00:00
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.
This commit is contained in:
parent
9f26fcce04
commit
8f034d9af2
3 changed files with 33 additions and 4 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue