mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-81057: Move the Remaining Import State Globals to _PyRuntimeState (gh-99488)
https://github.com/python/cpython/issues/81057
This commit is contained in:
parent
4e4b13e8f6
commit
e874c2f198
4 changed files with 30 additions and 12 deletions
|
@ -21,6 +21,17 @@ struct _import_runtime_state {
|
|||
This is initialized lazily in _PyImport_FixupExtensionObject().
|
||||
Modules are added there and looked up in _imp.find_extension(). */
|
||||
PyObject *extensions;
|
||||
/* The global import lock. */
|
||||
struct {
|
||||
PyThread_type_lock mutex;
|
||||
unsigned long thread;
|
||||
int level;
|
||||
} lock;
|
||||
struct {
|
||||
int import_level;
|
||||
_PyTime_t accumulated;
|
||||
int header;
|
||||
} find_and_load;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -39,6 +39,16 @@ extern "C" {
|
|||
.types = { \
|
||||
.next_version_tag = 1, \
|
||||
}, \
|
||||
.imports = { \
|
||||
.lock = { \
|
||||
.mutex = NULL, \
|
||||
.thread = PYTHREAD_INVALID_THREAD_ID, \
|
||||
.level = 0, \
|
||||
}, \
|
||||
.find_and_load = { \
|
||||
.header = 1, \
|
||||
}, \
|
||||
}, \
|
||||
.global_objects = { \
|
||||
.singletons = { \
|
||||
.small_ints = _Py_small_ints_INIT, \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue