Issue #18418: After fork(), reinit all threads states, not only active ones.
Patch by A. Jesse Jiryu Davis.
diff --git a/Lib/threading.py b/Lib/threading.py
index 225448b..72c8319 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -1220,7 +1220,7 @@
new_active = {}
current = current_thread()
with _active_limbo_lock:
- for thread in _active.itervalues():
+ for thread in _enumerate():
# Any lock/condition variable may be currently locked or in an
# invalid state, so we reinitialize them.
if hasattr(thread, '_reset_internal_locks'):