mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-120838: Add _PyThreadState_WHENCE_FINI (gh-121010)
We also add _PyThreadState_NewBound() and drop _PyThreadState_SetWhence(). This change only affects internal API.
This commit is contained in:
parent
769aea3329
commit
a905721b9c
8 changed files with 27 additions and 27 deletions
|
@ -1544,8 +1544,7 @@ _enter_session(_PyXI_session *session, PyInterpreterState *interp)
|
|||
PyThreadState *tstate = PyThreadState_Get();
|
||||
PyThreadState *prev = tstate;
|
||||
if (interp != tstate->interp) {
|
||||
tstate = PyThreadState_New(interp);
|
||||
_PyThreadState_SetWhence(tstate, _PyThreadState_WHENCE_EXEC);
|
||||
tstate = _PyThreadState_NewBound(interp, _PyThreadState_WHENCE_EXEC);
|
||||
// XXX Possible GILState issues?
|
||||
session->prev_tstate = PyThreadState_Swap(tstate);
|
||||
assert(session->prev_tstate == prev);
|
||||
|
@ -1895,8 +1894,7 @@ _PyXI_EndInterpreter(PyInterpreterState *interp,
|
|||
tstate = cur_tstate;
|
||||
}
|
||||
else {
|
||||
tstate = PyThreadState_New(interp);
|
||||
_PyThreadState_SetWhence(tstate, _PyThreadState_WHENCE_INTERP);
|
||||
tstate = _PyThreadState_NewBound(interp, _PyThreadState_WHENCE_FINI);
|
||||
assert(tstate != NULL);
|
||||
save_tstate = PyThreadState_Swap(tstate);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue