summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2024-02-06 19:45:04 (GMT)
committerGitHub <noreply@github.com>2024-02-06 19:45:04 (GMT)
commitb6228b521b4692b2de1c1c12f4aa5623f8319084 (patch)
treea173751e1e7882a755bf6d2b75e38ac833430fd6 /Python/pystate.c
parent71239d50b54c90afd3fdde260848e0c6d73a5c27 (diff)
downloadcpython-b6228b521b4692b2de1c1c12f4aa5623f8319084.zip
cpython-b6228b521b4692b2de1c1c12f4aa5623f8319084.tar.gz
cpython-b6228b521b4692b2de1c1c12f4aa5623f8319084.tar.bz2
gh-115035: Mark ThreadHandles as non-joinable earlier after forking (#115042)
This marks dead ThreadHandles as non-joinable earlier in `PyOS_AfterFork_Child()` before we execute any Python code. The handles are stored in a global linked list in `_PyRuntimeState` because `fork()` affects the entire process.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 7836c17..e77e5bf 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -517,6 +517,8 @@ _PyRuntimeState_ReInitThreads(_PyRuntimeState *runtime)
return _PyStatus_NO_MEMORY();
}
+ _PyThread_AfterFork(&runtime->threads);
+
return _PyStatus_OK();
}
#endif