mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-40268: Add pycore_runtime.h header file (GH-19493)
Move PyRuntimeState from pycore_pystate.h to pycore_runtime.h. Remove _PyGILState_check_enabled macro: access directly _PyRuntime.gilstate.check_enabled.
This commit is contained in:
parent
0135598d72
commit
1c4cbdf94d
7 changed files with 152 additions and 125 deletions
|
@ -1553,7 +1553,7 @@ new_interpreter(PyThreadState **tstate_p)
|
|||
|
||||
/* Issue #10915, #15751: The GIL API doesn't work with multiple
|
||||
interpreters: disable PyGILState_Check(). */
|
||||
_PyGILState_check_enabled = 0;
|
||||
runtime->gilstate.check_enabled = 0;
|
||||
|
||||
PyInterpreterState *interp = PyInterpreterState_New();
|
||||
if (interp == NULL) {
|
||||
|
|
|
@ -1329,12 +1329,11 @@ PyGILState_GetThisThreadState(void)
|
|||
int
|
||||
PyGILState_Check(void)
|
||||
{
|
||||
|
||||
if (!_PyGILState_check_enabled) {
|
||||
struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate;
|
||||
if (!gilstate->check_enabled) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate;
|
||||
if (!PyThread_tss_is_created(&gilstate->autoTSSkey)) {
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue