Author Michael.Felt
Recipients Michael.Felt, shihai1991, vstinner
Date 2021-04-01.11:20:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1617276055.75.0.355224022347.issue40092@roundup.psfhosted.org>
In-reply-to
Content
OK. Please explain. Looking at tstate assignment

In posixmodule.c:PyOSAfterFork_Child()
    PyStatus status;
    _PyRuntimeState *runtime = &_PyRuntime;

...
    PyThreadState *tstate = _PyThreadState_GET();

and later calls
    status = _PyRuntimeState_ReInitThreads(runtime);

Yet in Posix/ceval.c
PyStatus
_PyEval_ReInitThreads(PyThreadState *tstate)
{
    _PyRuntimeState *runtime = tstate->interp->runtime;

** this looks like runtime->interp->runtime

And then we get down to:
    /* Destroy all threads except the current one */
    _PyThreadState_DeleteExcept(runtime, tstate);

Is this correct - as it looks like:
_PyThreadState_DeleteExcept(runtime->interp->runtime, runtime) -- where runtime == &_PyRuntime;
History
Date User Action Args
2021-04-01 11:20:55Michael.Feltsetrecipients: + Michael.Felt, vstinner, shihai1991
2021-04-01 11:20:55Michael.Feltsetmessageid: <1617276055.75.0.355224022347.issue40092@roundup.psfhosted.org>
2021-04-01 11:20:55Michael.Feltlinkissue40092 messages
2021-04-01 11:20:55Michael.Feltcreate