diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-09-17 21:59:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-17 21:59:51 (GMT) |
commit | d3b904144e86e2442961de6a7dccecbe133d5c6d (patch) | |
tree | 0663e8625cbadbb1fce208e16902ee0bc7753fa8 /Include | |
parent | b39afb78768418d9405c4b528c80fa968ccc974d (diff) | |
download | cpython-d3b904144e86e2442961de6a7dccecbe133d5c6d.zip cpython-d3b904144e86e2442961de6a7dccecbe133d5c6d.tar.gz cpython-d3b904144e86e2442961de6a7dccecbe133d5c6d.tar.bz2 |
bpo-38070: Add _PyRuntimeState.preinitializing (GH-16245)
Add _PyRuntimeState.preinitializing field: set to 1 while
Py_PreInitialize() is running.
_PyRuntimeState: rename also pre_initialized field to preinitialized.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_pystate.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index 0f92f67..8e5a022 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -190,8 +190,11 @@ struct _gilstate_runtime_state { /* Full Python runtime state */ typedef struct pyruntimestate { - /* Is Python pre-initialized? Set to 1 by Py_PreInitialize() */ - int pre_initialized; + /* Is running Py_PreInitialize()? */ + int preinitializing; + + /* Is Python preinitialized? Set to 1 by Py_PreInitialize() */ + int preinitialized; /* Is Python core initialized? Set to 1 by _Py_InitializeCore() */ int core_initialized; @@ -199,6 +202,8 @@ typedef struct pyruntimestate { /* Is Python fully initialized? Set to 1 by Py_Initialize() */ int initialized; + /* Set by Py_FinalizeEx(). Only reset to NULL if Py_Initialize() + is called again. */ PyThreadState *finalizing; struct pyinterpreters { @@ -241,7 +246,7 @@ typedef struct pyruntimestate { } _PyRuntimeState; #define _PyRuntimeState_INIT \ - {.pre_initialized = 0, .core_initialized = 0, .initialized = 0} + {.preinitialized = 0, .core_initialized = 0, .initialized = 0} /* Note: _PyRuntimeState_INIT sets other fields to 0/NULL */ PyAPI_DATA(_PyRuntimeState) _PyRuntime; |