mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +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
|
@ -1518,11 +1518,11 @@ switch_to_main_interpreter(PyThreadState *tstate)
|
|||
if (_Py_IsMainInterpreter(tstate->interp)) {
|
||||
return tstate;
|
||||
}
|
||||
PyThreadState *main_tstate = PyThreadState_New(_PyInterpreterState_Main());
|
||||
PyThreadState *main_tstate = _PyThreadState_NewBound(
|
||||
_PyInterpreterState_Main(), _PyThreadState_WHENCE_EXEC);
|
||||
if (main_tstate == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
main_tstate->_whence = _PyThreadState_WHENCE_EXEC;
|
||||
#ifndef NDEBUG
|
||||
PyThreadState *old_tstate = PyThreadState_Swap(main_tstate);
|
||||
assert(old_tstate == tstate);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue