summaryrefslogtreecommitdiffstats
path: root/Lib/threading.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-06-16 09:41:17 (GMT)
committerGitHub <noreply@github.com>2021-06-16 09:41:17 (GMT)
commit0729694246174a5c2f0ae197f2e0dbea61b90c9f (patch)
treef248d76556a6095fe63e2d96e857db7a0bae6588 /Lib/threading.py
parent7cad9cb51bdae2144cbab330f13a607ba3471742 (diff)
downloadcpython-0729694246174a5c2f0ae197f2e0dbea61b90c9f.zip
cpython-0729694246174a5c2f0ae197f2e0dbea61b90c9f.tar.gz
cpython-0729694246174a5c2f0ae197f2e0dbea61b90c9f.tar.bz2
bpo-44422: threading.Thread reuses the _delete() method (GH-26741)
The _bootstrap_inner() method of threading.Thread now reuses its _delete() method rather than accessing _active() directly. It became possible since _active_limbo_lock became reentrant. Moreover, it no longer ignores any exception when deleting the thread from the _active dictionary.
Diffstat (limited to 'Lib/threading.py')
-rw-r--r--Lib/threading.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/Lib/threading.py b/Lib/threading.py
index 766011f..c2b94a5 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -1010,13 +1010,7 @@ class Thread:
except:
self._invoke_excepthook(self)
finally:
- with _active_limbo_lock:
- try:
- # We don't call self._delete() because it also
- # grabs _active_limbo_lock.
- del _active[get_ident()]
- except:
- pass
+ self._delete()
def _stop(self):
# After calling ._stop(), .is_alive() returns False and .join() returns