summaryrefslogtreecommitdiffstats
path: root/Python/pylifecycle.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-06-01 22:24:10 (GMT)
committerGitHub <noreply@github.com>2023-06-01 22:24:10 (GMT)
commit3698fda06eefb3c01e78c4c07f46fcdd0559e0f6 (patch)
treeaa978df64aae6acd5bb007708e3d4ff37388f9aa /Python/pylifecycle.c
parent8a8ebf2e3ddb880806237c7a5983f9744f7c215f (diff)
downloadcpython-3698fda06eefb3c01e78c4c07f46fcdd0559e0f6.zip
cpython-3698fda06eefb3c01e78c4c07f46fcdd0559e0f6.tar.gz
cpython-3698fda06eefb3c01e78c4c07f46fcdd0559e0f6.tar.bz2
gh-104341: Call _PyEval_ReleaseLock() with NULL When Finalizing the Current Thread (gh-105109)
This avoids the problematic race in drop_gil() by skipping the FORCE_SWITCHING code there for finalizing threads. (The idea for this approach came out of discussions with @markshannon.)
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r--Python/pylifecycle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index c6fbf17..4c21160 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -2035,7 +2035,7 @@ new_interpreter(PyThreadState **tstate_p, const PyInterpreterConfig *config)
const PyConfig *src_config;
if (save_tstate != NULL) {
// XXX Might new_interpreter() have been called without the GIL held?
- _PyEval_ReleaseLock(save_tstate);
+ _PyEval_ReleaseLock(save_tstate->interp, save_tstate);
src_config = _PyInterpreterState_GetConfig(save_tstate->interp);
}
else