mirror of
https://github.com/python/cpython.git
synced 2025-08-19 00:00:48 +00:00
[3.12] gh-105603: Change the PyInterpreterConfig.own gil Field (gh-105620) (gh-105731)
We are changing it to be more flexible that a strict bool can be for possible future expanded used cases.
(cherry picked from commit b97e14a806
)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
This commit is contained in:
parent
9c51ea5d55
commit
c3a2cbb54d
6 changed files with 40 additions and 16 deletions
|
@ -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 --------------------------------------- */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue