◐ Shell
clean mode source ↗

[3.10] bpo-44422: Fix threading.enumerate() reentrant call (GH-26727) by miss-islington · Pull Request #26737 · python/cpython

Expand Up @@ -775,8 +775,11 @@ class BrokenBarrierError(RuntimeError): def _newname(name_template): return name_template % _counter()
# Active thread administration _active_limbo_lock = _allocate_lock() # Active thread administration. # # bpo-44422: Use a reentrant lock to allow reentrant calls to functions like # threading.enumerate(). _active_limbo_lock = RLock() _active = {} # maps thread id to Thread object _limbo = {} _dangling = WeakSet() Expand Down Expand Up @@ -1564,7 +1567,7 @@ def _after_fork(): # by another (non-forked) thread. http://bugs.python.org/issue874900 global _active_limbo_lock, _main_thread global _shutdown_locks_lock, _shutdown_locks _active_limbo_lock = _allocate_lock() _active_limbo_lock = RLock()
# fork() only copied the current thread; clear references to others. new_active = {} Expand Down