bpo-36710: Use tstate in pylifecycle.c (GH-14249)

In pylifecycle.c: pass tstate argument, rather than interp argument,
to functions.
This commit is contained in:
Victor Stinner 2019-06-20 00:05:23 +02:00 committed by GitHub
parent 35068bd059
commit b45d259bdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 121 additions and 109 deletions

View file

@ -1143,19 +1143,18 @@ PyThreadState_IsCurrent(PyThreadState *tstate)
Py_Initialize/Py_FinalizeEx
*/
void
_PyGILState_Init(_PyRuntimeState *runtime,
PyInterpreterState *interp, PyThreadState *tstate)
_PyGILState_Init(_PyRuntimeState *runtime, PyThreadState *tstate)
{
/* must init with valid states */
assert(interp != NULL);
assert(tstate != NULL);
assert(tstate->interp != NULL);
struct _gilstate_runtime_state *gilstate = &runtime->gilstate;
if (PyThread_tss_create(&gilstate->autoTSSkey) != 0) {
Py_FatalError("Could not allocate TSS entry");
}
gilstate->autoInterpreterState = interp;
gilstate->autoInterpreterState = tstate->interp;
assert(PyThread_tss_get(&gilstate->autoTSSkey) == NULL);
assert(tstate->gilstate_counter == 0);