void *arg);
PyAPI_FUNC(void) _PyEval_SignalAsyncExc(PyThreadState *tstate);
#ifdef HAVE_FORK
-extern PyStatus _PyEval_ReInitThreads(struct pyruntimestate *runtime);
+extern PyStatus _PyEval_ReInitThreads(PyThreadState *tstate);
#endif
PyAPI_FUNC(void) _PyEval_SetCoroutineOriginTrackingDepth(
PyThreadState *tstate,
goto fatal_error;
}
- status = _PyEval_ReInitThreads(runtime);
+ PyThreadState *tstate = _PyThreadState_GET();
+ _Py_EnsureTstateNotNULL(tstate);
+
+ status = _PyEval_ReInitThreads(tstate);
if (_PyStatus_EXCEPTION(status)) {
goto fatal_error;
}
if (_PyStatus_EXCEPTION(status)) {
goto fatal_error;
}
+ assert(_PyThreadState_GET() == tstate);
- run_at_forkers(_PyInterpreterState_GET()->after_forkers_child, 0);
+ run_at_forkers(tstate->interp->after_forkers_child, 0);
return;
fatal_error:
which are not running in the child process, and clear internal locks
which might be held by those threads. */
PyStatus
-_PyEval_ReInitThreads(_PyRuntimeState *runtime)
+_PyEval_ReInitThreads(PyThreadState *tstate)
{
- PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime);
- _Py_EnsureTstateNotNULL(tstate);
+ _PyRuntimeState *runtime = tstate->interp->runtime;
#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
struct _gil_runtime_state *gil = &tstate->interp->ceval.gil;