mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
[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
This commit is contained in:
parent
c38ceb032d
commit
d2be5c73ed
4 changed files with 46 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue