Skip to content

Commit d32b7fc

Browse files
committed
bpo-44422: threading.Thread reuses the _delete() method
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.
1 parent 243fd01 commit d32b7fc

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Lib/threading.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,13 +1010,7 @@ def _bootstrap_inner(self):
10101010
except:
10111011
self._invoke_excepthook(self)
10121012
finally:
1013-
with _active_limbo_lock:
1014-
try:
1015-
# We don't call self._delete() because it also
1016-
# grabs _active_limbo_lock.
1017-
del _active[get_ident()]
1018-
except:
1019-
pass
1013+
self._delete()
10201014

10211015
def _stop(self):
10221016
# After calling ._stop(), .is_alive() returns False and .join() returns

0 commit comments

Comments
 (0)