[3.10] bpo-44422: Fix threading.enumerate() reentrant call (GH-26727) by miss-islington · Pull Request #26737 · python/cpython
# 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()
# fork() only copied the current thread; clear references to others. new_active = {}