mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
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.
This commit is contained in:
parent
8e91c246e4
commit
43125224d6
6 changed files with 104 additions and 71 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue