summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/pystate.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 892e740..cee481c 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -506,6 +506,15 @@ _PyRuntimeState_ReInitThreads(_PyRuntimeState *runtime)
for (size_t i = 0; i < Py_ARRAY_LENGTH(locks); i++) {
_PyMutex_at_fork_reinit(locks[i]);
}
+#ifdef Py_GIL_DISABLED
+ for (PyInterpreterState *interp = runtime->interpreters.head;
+ interp != NULL; interp = interp->next)
+ {
+ for (int i = 0; i < NUM_WEAKREF_LIST_LOCKS; i++) {
+ _PyMutex_at_fork_reinit(&interp->weakref_locks[i]);
+ }
+ }
+#endif
_PyTypes_AfterFork();