summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2022-01-13 23:33:40 (GMT)
committerGitHub <noreply@github.com>2022-01-13 23:33:40 (GMT)
commitb8ddf7e794e5316981016d6d014862e3c4ce149a (patch)
treeb351b3bda79db119c6ba679649d3180fc7811fc1 /Include
parentbc02eac9d2cb36faffc5027b7ce09e6dd0922a7f (diff)
downloadcpython-b8ddf7e794e5316981016d6d014862e3c4ce149a.zip
cpython-b8ddf7e794e5316981016d6d014862e3c4ce149a.tar.gz
cpython-b8ddf7e794e5316981016d6d014862e3c4ce149a.tar.bz2
Statically initialize _PyRuntimeState fields. (gh-30588)
https://bugs.python.org/issue45953
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_runtime_init.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/Include/internal/pycore_runtime_init.h b/Include/internal/pycore_runtime_init.h
index e35c696..fc768ff 100644
--- a/Include/internal/pycore_runtime_init.h
+++ b/Include/internal/pycore_runtime_init.h
@@ -17,6 +17,17 @@ extern "C" {
#define _PyRuntimeState_INIT \
{ \
+ .gilstate = { \
+ .check_enabled = 1, \
+ /* A TSS key must be initialized with Py_tss_NEEDS_INIT \
+ in accordance with the specification. */ \
+ .autoTSSkey = Py_tss_NEEDS_INIT, \
+ }, \
+ .interpreters = { \
+ /* This prevents interpreters from getting created \
+ until _PyInterpreterState_Enable() is called. */ \
+ .next_id = -1, \
+ }, \
.global_objects = _Py_global_objects_INIT, \
._main_interpreter = _PyInterpreterState_INIT, \
}