gh-111956: Add thread-safe one-time initialization. (gh-111960)

This commit is contained in:
Sam Gross
2023-11-16 14:19:54 -05:00
committed by GitHub
parent f66afa395a
commit 446f18a911
11 changed files with 1061 additions and 955 deletions

View File

@@ -379,12 +379,11 @@ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
static const _PyRuntimeState initial = _PyRuntimeState_INIT(_PyRuntime);
_Py_COMP_DIAG_POP
#define NUMLOCKS 9
#define NUMLOCKS 8
#define LOCKS_INIT(runtime) \
{ \
&(runtime)->interpreters.mutex, \
&(runtime)->xi.registry.mutex, \
&(runtime)->getargs.mutex, \
&(runtime)->unicode_state.ids.lock, \
&(runtime)->imports.extensions.mutex, \
&(runtime)->ceval.pending_mainthread.lock, \