mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
gh-104341: Adjust tstate_must_exit() to Respect Interpreter Finalization (gh-104437)
With the move to a per-interpreter GIL, this check slipped through the cracks.
This commit is contained in:
parent
cb88ae635e
commit
26baa747c2
11 changed files with 56 additions and 10 deletions
|
|
@ -332,6 +332,9 @@ tstate_must_exit(PyThreadState *tstate)
|
|||
After Py_Finalize() has been called, tstate can be a dangling pointer:
|
||||
point to PyThreadState freed memory. */
|
||||
PyThreadState *finalizing = _PyRuntimeState_GetFinalizing(&_PyRuntime);
|
||||
if (finalizing == NULL) {
|
||||
finalizing = _PyInterpreterState_GetFinalizing(tstate->interp);
|
||||
}
|
||||
return (finalizing != NULL && finalizing != tstate);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue