From 43125224d6da5febb34101ebfd36536d791d68cd Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 24 Apr 2019 18:23:53 +0200 Subject: bpo-36710: Add runtime variable to Py_InitializeEx() (GH-12939) Py_InitializeEx() now uses a runtime variable passed to subfunctions, rather than working directly on the global variable _PyRuntime. Add 'runtime' parameter to _PyCoreConfig_Write(), _PySys_Create(), _PySys_InitMain(), _PyGILState_Init(), emit_stderr_warning_for_legacy_locale() and other subfunctions. --- Python/pystate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Python/pystate.c') diff --git a/Python/pystate.c b/Python/pystate.c index 498a9546e1..a413f9d7ab 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -1052,13 +1052,13 @@ PyThreadState_IsCurrent(PyThreadState *tstate) Py_Initialize/Py_FinalizeEx */ void -_PyGILState_Init(PyInterpreterState *interp, PyThreadState *tstate) +_PyGILState_Init(_PyRuntimeState *runtime, + PyInterpreterState *interp, PyThreadState *tstate) { /* must init with valid states */ assert(interp != NULL); assert(tstate != NULL); - _PyRuntimeState *runtime = &_PyRuntime; struct _gilstate_runtime_state *gilstate = &runtime->gilstate; if (PyThread_tss_create(&gilstate->autoTSSkey) != 0) { -- cgit v1.2.1