diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-06-13 17:08:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-13 17:08:32 (GMT) |
commit | b97e14a806477af4225777d215ac38c0d9b845f0 (patch) | |
tree | 35eb71251371258874274f6eb73ab09fe849b460 /Include | |
parent | abfbab6415fb029e7dca19ecc8d29a13da37bf71 (diff) | |
download | cpython-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.h | 10 |
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 --------------------------------------- */ |