diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-06-01 22:50:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-01 22:50:28 (GMT) |
commit | d2be5c73ed520fb9d82a395f001eb9001711ed8f (patch) | |
tree | b25d3a5a6d33c6d311bab307c205b905f3aae6a2 /Python/pylifecycle.c | |
parent | c38ceb032d59d6c8f2006ab9a347d7e207f9f84e (diff) | |
download | cpython-d2be5c73ed520fb9d82a395f001eb9001711ed8f.zip cpython-d2be5c73ed520fb9d82a395f001eb9001711ed8f.tar.gz cpython-d2be5c73ed520fb9d82a395f001eb9001711ed8f.tar.bz2 |
[3.12] gh-104341: Call _PyEval_ReleaseLock() with NULL When Finalizing the Current Thread (gh-105109) (gh-105209)
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.)
(cherry picked from commit 3698fda)
Co-authored-by: Eric Snow ericsnowcurrently@gmail.com
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r-- | Python/pylifecycle.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 06c4345..8b84644 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 |