summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-06-13 17:08:32 (GMT)
committerGitHub <noreply@github.com>2023-06-13 17:08:32 (GMT)
commitb97e14a806477af4225777d215ac38c0d9b845f0 (patch)
tree35eb71251371258874274f6eb73ab09fe849b460 /Include
parentabfbab6415fb029e7dca19ecc8d29a13da37bf71 (diff)
downloadcpython-b97e14a806477af4225777d215ac38c0d9b845f0.zip
cpython-b97e14a806477af4225777d215ac38c0d9b845f0.tar.gz
cpython-b97e14a806477af4225777d215ac38c0d9b845f0.tar.bz2
gh-105603: Change the PyInterpreterConfig.own gil Field (gh-105620)
We are changing it to be more flexible that a strict bool can be for possible future expanded used cases.
Diffstat (limited to 'Include')
-rw-r--r--Include/cpython/initconfig.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/Include/cpython/initconfig.h b/Include/cpython/initconfig.h
index efae240..c103c20 100644
--- a/Include/cpython/initconfig.h
+++ b/Include/cpython/initconfig.h
@@ -244,6 +244,10 @@ PyAPI_FUNC(PyStatus) PyConfig_SetWideStringList(PyConfig *config,
/* --- PyInterpreterConfig ------------------------------------ */
+#define PyInterpreterConfig_DEFAULT_GIL (0)
+#define PyInterpreterConfig_SHARED_GIL (1)
+#define PyInterpreterConfig_OWN_GIL (2)
+
typedef struct {
// XXX "allow_object_sharing"? "own_objects"?
int use_main_obmalloc;
@@ -252,7 +256,7 @@ typedef struct {
int allow_threads;
int allow_daemon_threads;
int check_multi_interp_extensions;
- int own_gil;
+ int gil;
} PyInterpreterConfig;
#define _PyInterpreterConfig_INIT \
@@ -263,7 +267,7 @@ typedef struct {
.allow_threads = 1, \
.allow_daemon_threads = 0, \
.check_multi_interp_extensions = 1, \
- .own_gil = 1, \
+ .gil = PyInterpreterConfig_OWN_GIL, \
}
#define _PyInterpreterConfig_LEGACY_INIT \
@@ -274,7 +278,7 @@ typedef struct {
.allow_threads = 1, \
.allow_daemon_threads = 1, \
.check_multi_interp_extensions = 0, \
- .own_gil = 0, \
+ .gil = PyInterpreterConfig_SHARED_GIL, \
}
/* --- Helper functions --------------------------------------- */