You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Lib/threading.py
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -775,8 +775,11 @@ class BrokenBarrierError(RuntimeError):
775
775
def_newname(name_template):
776
776
returnname_template%_counter()
777
777
778
-
# Active thread administration
779
-
_active_limbo_lock=_allocate_lock()
778
+
# Active thread administration.
779
+
#
780
+
# bpo-44422: Use a reentrant lock to allow reentrant calls to functions like
781
+
# threading.enumerate().
782
+
_active_limbo_lock=RLock()
780
783
_active= {} # maps thread id to Thread object
781
784
_limbo= {}
782
785
_dangling=WeakSet()
@@ -1564,7 +1567,7 @@ def _after_fork():
1564
1567
# by another (non-forked) thread. http://bugs.python.org/issue874900
1565
1568
global_active_limbo_lock, _main_thread
1566
1569
global_shutdown_locks_lock, _shutdown_locks
1567
-
_active_limbo_lock=_allocate_lock()
1570
+
_active_limbo_lock=RLock()
1568
1571
1569
1572
# fork() only copied the current thread; clear references to others.
0 commit comments