mirror of
https://github.com/python/cpython.git
synced 2025-10-28 17:13:08 +00:00
gh-99113: Add PyInterpreterConfig.own_gil (gh-104204)
We also add PyInterpreterState.ceval.own_gil to record if the interpreter actually has its own GIL. Note that for now we don't actually respect own_gil; all interpreters still share the one GIL. However, PyInterpreterState.ceval.own_gil does reflect PyInterpreterConfig.own_gil. That lie is a temporary one that we will fix when the GIL really becomes per-interpreter.
This commit is contained in:
parent
66558d2a16
commit
f3e7eb48f8
11 changed files with 79 additions and 18 deletions
|
|
@ -252,6 +252,7 @@ typedef struct {
|
|||
int allow_threads;
|
||||
int allow_daemon_threads;
|
||||
int check_multi_interp_extensions;
|
||||
int own_gil;
|
||||
} PyInterpreterConfig;
|
||||
|
||||
#define _PyInterpreterConfig_INIT \
|
||||
|
|
@ -262,6 +263,7 @@ typedef struct {
|
|||
.allow_threads = 1, \
|
||||
.allow_daemon_threads = 0, \
|
||||
.check_multi_interp_extensions = 1, \
|
||||
.own_gil = 1, \
|
||||
}
|
||||
|
||||
#define _PyInterpreterConfig_LEGACY_INIT \
|
||||
|
|
@ -272,6 +274,7 @@ typedef struct {
|
|||
.allow_threads = 1, \
|
||||
.allow_daemon_threads = 1, \
|
||||
.check_multi_interp_extensions = 0, \
|
||||
.own_gil = 0, \
|
||||
}
|
||||
|
||||
/* --- Helper functions --------------------------------------- */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue