summaryrefslogtreecommitdiffstats
path: root/Lib/threading.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-01-22 01:20:42 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-01-22 01:20:42 (GMT)
commit95cd5c0b72db09426f96c8e5716404da01048f93 (patch)
treee689b7c7d35b345d6038825cbad7fa136c4b59f9 /Lib/threading.py
parent64c5677de4e979d1496d8851dcc27078caa89d40 (diff)
downloadcpython-95cd5c0b72db09426f96c8e5716404da01048f93.zip
cpython-95cd5c0b72db09426f96c8e5716404da01048f93.tar.gz
cpython-95cd5c0b72db09426f96c8e5716404da01048f93.tar.bz2
- 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.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/threading.py b/Lib/threading.py
index 98d15b2..50cbb06 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -515,11 +515,14 @@ class Thread(_Verbose):
if __debug__:
self._note("%s.__bootstrap(): normal return", self)
finally:
- self.__stop()
- try:
- self.__delete()
- except:
- pass
+ with _active_limbo_lock:
+ self.__stop()
+ try:
+ # We don't call self.__delete() because it also
+ # grabs _active_limbo_lock.
+ del _active[_get_ident()]
+ except:
+ pass
def __stop(self):
with self.__block: