Lines Matching defs:gilstate
40 #define _PyRuntimeGILState_GetThreadState(gilstate) \
41 ((PyThreadState*)_Py_atomic_load_relaxed(&(gilstate)->tstate_current))
42 #define _PyRuntimeGILState_SetThreadState(gilstate, value) \
43 _Py_atomic_store_relaxed(&(gilstate)->tstate_current, \
47 static PyThreadState *_PyGILState_GetThisThreadState(struct _gilstate_runtime_state *gilstate);
223 struct _gilstate_runtime_state *gilstate, PyThreadState* tstate);
498 _PyThreadState_Swap(&runtime->gilstate, NULL);
538 struct _gilstate_runtime_state *gilstate = &runtime->gilstate;
541 PyThreadState *tstate = _PyThreadState_Swap(gilstate, NULL);
571 _PyThreadState_Swap(gilstate, tstate);
672 struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate;
683 PyThreadState *save_tstate = _PyThreadState_Swap(gilstate, tstate);
685 _PyThreadState_Swap(gilstate, save_tstate);
885 _PyGILState_NoteThreadState(&tstate->interp->runtime->gilstate, tstate);
1071 struct _gilstate_runtime_state *gilstate)
1092 if (gilstate->autoInterpreterState &&
1093 PyThread_tss_get(&gilstate->autoTSSkey) == tstate)
1095 PyThread_tss_set(&gilstate->autoTSSkey, NULL);
1109 struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate;
1111 if (tstate == _PyRuntimeGILState_GetThreadState(gilstate)) {
1115 tstate_delete_common(tstate, gilstate);
1131 struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate;
1132 tstate_delete_common(tstate, gilstate);
1133 _PyRuntimeGILState_SetThreadState(gilstate, NULL);
1141 struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate;
1142 PyThreadState *tstate = _PyRuntimeGILState_GetThreadState(gilstate);
1206 _PyThreadState_Swap(struct _gilstate_runtime_state *gilstate, PyThreadState *newts)
1208 PyThreadState *oldts = _PyRuntimeGILState_GetThreadState(gilstate);
1210 _PyRuntimeGILState_SetThreadState(gilstate, newts);
1221 PyThreadState *check = _PyGILState_GetThisThreadState(gilstate);
1233 return _PyThreadState_Swap(&_PyRuntime.gilstate, newts);
1515 struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate;
1516 assert(_PyGILState_GetThisThreadState(gilstate) == tstate);
1517 return tstate == _PyRuntimeGILState_GetThreadState(gilstate);
1526 struct _gilstate_runtime_state *gilstate = &runtime->gilstate;
1527 if (PyThread_tss_create(&gilstate->autoTSSkey) != 0) {
1532 assert(gilstate->autoInterpreterState == NULL);
1550 struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate;
1552 gilstate->autoInterpreterState = tstate->interp;
1553 assert(PyThread_tss_get(&gilstate->autoTSSkey) == NULL);
1556 _PyGILState_NoteThreadState(gilstate, tstate);
1563 return _PyRuntime.gilstate.autoInterpreterState;
1569 struct _gilstate_runtime_state *gilstate = &interp->runtime->gilstate;
1570 PyThread_tss_delete(&gilstate->autoTSSkey);
1571 gilstate->autoInterpreterState = NULL;
1582 struct _gilstate_runtime_state *gilstate = &runtime->gilstate;
1583 PyThreadState *tstate = _PyGILState_GetThisThreadState(gilstate);
1585 PyThread_tss_delete(&gilstate->autoTSSkey);
1586 if (PyThread_tss_create(&gilstate->autoTSSkey) != 0) {
1593 PyThread_tss_set(&gilstate->autoTSSkey, (void *)tstate) != 0)
1607 _PyGILState_NoteThreadState(struct _gilstate_runtime_state *gilstate, PyThreadState* tstate)
1612 if (!gilstate->autoInterpreterState) {
1628 if (PyThread_tss_get(&gilstate->autoTSSkey) == NULL) {
1629 if ((PyThread_tss_set(&gilstate->autoTSSkey, (void *)tstate)) != 0) {
1640 _PyGILState_GetThisThreadState(struct _gilstate_runtime_state *gilstate)
1642 if (gilstate->autoInterpreterState == NULL)
1644 return (PyThreadState *)PyThread_tss_get(&gilstate->autoTSSkey);
1650 return _PyGILState_GetThisThreadState(&_PyRuntime.gilstate);
1656 struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate;
1657 if (!gilstate->check_enabled) {
1661 if (!PyThread_tss_is_created(&gilstate->autoTSSkey)) {
1665 PyThreadState *tstate = _PyRuntimeGILState_GetThreadState(gilstate);
1670 return (tstate == _PyGILState_GetThisThreadState(gilstate));
1677 struct _gilstate_runtime_state *gilstate = &runtime->gilstate;
1687 assert(gilstate->autoInterpreterState);
1689 PyThreadState *tcur = (PyThreadState *)PyThread_tss_get(&gilstate->autoTSSkey);
1693 tcur = PyThreadState_New(gilstate->autoInterpreterState);
1725 PyThreadState *tstate = PyThread_tss_get(&runtime->gilstate.autoTSSkey);
1757 assert(_PyRuntimeGILState_GetThreadState(&runtime->gilstate) == tstate);
1866 _call_in_interpreter(struct _gilstate_runtime_state *gilstate,
1875 if (interp != _PyRuntimeGILState_GetThreadState(gilstate)->interp) {
1879 save_tstate = _PyThreadState_Swap(gilstate, tstate);
1886 _PyThreadState_Swap(gilstate, save_tstate);
1909 struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate;
1910 _call_in_interpreter(gilstate, interp, _release_xidata, data);