• Home
  • Raw
  • Download

Lines Matching refs:gilstate

37 #define _PyRuntimeGILState_GetThreadState(gilstate) \  argument
38 ((PyThreadState*)_Py_atomic_load_relaxed(&(gilstate)->tstate_current))
39 #define _PyRuntimeGILState_SetThreadState(gilstate, value) \ argument
40 _Py_atomic_store_relaxed(&(gilstate)->tstate_current, \
44 static PyThreadState *_PyGILState_GetThisThreadState(struct _gilstate_runtime_state *gilstate);
71 runtime->gilstate.check_enabled = 1; in _PyRuntimeState_Init_impl()
76 runtime->gilstate.autoTSSkey = initial; in _PyRuntimeState_Init_impl()
178 struct _gilstate_runtime_state *gilstate, PyThreadState* tstate);
387 _PyThreadState_Swap(&runtime->gilstate, NULL); in PyInterpreterState_Delete()
427 struct _gilstate_runtime_state *gilstate = &runtime->gilstate; in _PyInterpreterState_DeleteExceptMain() local
430 PyThreadState *tstate = _PyThreadState_Swap(gilstate, NULL); in _PyInterpreterState_DeleteExceptMain()
460 _PyThreadState_Swap(gilstate, tstate); in _PyInterpreterState_DeleteExceptMain()
561 struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; in _PyInterpreterState_IDDecref() local
572 PyThreadState *save_tstate = _PyThreadState_Swap(gilstate, tstate); in _PyInterpreterState_IDDecref()
574 _PyThreadState_Swap(gilstate, save_tstate); in _PyInterpreterState_IDDecref()
696 _PyGILState_NoteThreadState(&tstate->interp->runtime->gilstate, tstate); in _PyThreadState_Init()
884 struct _gilstate_runtime_state *gilstate) in tstate_delete_common() argument
905 if (gilstate->autoInterpreterState && in tstate_delete_common()
906 PyThread_tss_get(&gilstate->autoTSSkey) == tstate) in tstate_delete_common()
908 PyThread_tss_set(&gilstate->autoTSSkey, NULL); in tstate_delete_common()
916 struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; in _PyThreadState_Delete() local
918 if (tstate == _PyRuntimeGILState_GetThreadState(gilstate)) { in _PyThreadState_Delete()
922 tstate_delete_common(tstate, gilstate); in _PyThreadState_Delete()
938 struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; in _PyThreadState_DeleteCurrent() local
939 tstate_delete_common(tstate, gilstate); in _PyThreadState_DeleteCurrent()
940 _PyRuntimeGILState_SetThreadState(gilstate, NULL); in _PyThreadState_DeleteCurrent()
948 struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; in PyThreadState_DeleteCurrent() local
949 PyThreadState *tstate = _PyRuntimeGILState_GetThreadState(gilstate); in PyThreadState_DeleteCurrent()
999 return PyThread_tss_get(&_PyRuntime.gilstate.autoTSSkey); in _PyThreadState_GetTSS()
1021 _PyThreadState_Swap(struct _gilstate_runtime_state *gilstate, PyThreadState *newts) in _PyThreadState_Swap() argument
1026 PyThreadState *oldts = _PyRuntimeGILState_GetThreadState(gilstate); in _PyThreadState_Swap()
1029 _PyRuntimeGILState_SetThreadState(gilstate, newts); in _PyThreadState_Swap()
1040 PyThreadState *check = _PyGILState_GetThisThreadState(gilstate); in _PyThreadState_Swap()
1047 PyThread_tss_set(&gilstate->autoTSSkey, newts); in _PyThreadState_Swap()
1055 return _PyThreadState_Swap(&_PyRuntime.gilstate, newts); in PyThreadState_Swap()
1324 struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; in PyThreadState_IsCurrent() local
1325 assert(_PyGILState_GetThisThreadState(gilstate) == tstate); in PyThreadState_IsCurrent()
1326 return tstate == _PyRuntimeGILState_GetThreadState(gilstate); in PyThreadState_IsCurrent()
1335 struct _gilstate_runtime_state *gilstate = &runtime->gilstate; in _PyGILState_Init() local
1336 if (PyThread_tss_create(&gilstate->autoTSSkey) != 0) { in _PyGILState_Init()
1341 assert(gilstate->autoInterpreterState == NULL); in _PyGILState_Init()
1359 struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate; in _PyGILState_SetTstate() local
1361 gilstate->autoInterpreterState = tstate->interp; in _PyGILState_SetTstate()
1362 assert(PyThread_tss_get(&gilstate->autoTSSkey) == NULL); in _PyGILState_SetTstate()
1365 _PyGILState_NoteThreadState(gilstate, tstate); in _PyGILState_SetTstate()
1372 return _PyRuntime.gilstate.autoInterpreterState; in _PyGILState_GetInterpreterStateUnsafe()
1378 struct _gilstate_runtime_state *gilstate = &interp->runtime->gilstate; in _PyGILState_Fini() local
1379 PyThread_tss_delete(&gilstate->autoTSSkey); in _PyGILState_Fini()
1380 gilstate->autoInterpreterState = NULL; in _PyGILState_Fini()
1391 struct _gilstate_runtime_state *gilstate = &runtime->gilstate; in _PyGILState_Reinit() local
1392 PyThreadState *tstate = _PyGILState_GetThisThreadState(gilstate); in _PyGILState_Reinit()
1394 PyThread_tss_delete(&gilstate->autoTSSkey); in _PyGILState_Reinit()
1395 if (PyThread_tss_create(&gilstate->autoTSSkey) != 0) { in _PyGILState_Reinit()
1402 PyThread_tss_set(&gilstate->autoTSSkey, (void *)tstate) != 0) in _PyGILState_Reinit()
1416 _PyGILState_NoteThreadState(struct _gilstate_runtime_state *gilstate, PyThreadState* tstate) in _PyGILState_NoteThreadState() argument
1421 if (!gilstate->autoInterpreterState) { in _PyGILState_NoteThreadState()
1437 if (PyThread_tss_get(&gilstate->autoTSSkey) == NULL) { in _PyGILState_NoteThreadState()
1438 if ((PyThread_tss_set(&gilstate->autoTSSkey, (void *)tstate)) != 0) { in _PyGILState_NoteThreadState()
1449 _PyGILState_GetThisThreadState(struct _gilstate_runtime_state *gilstate) in _PyGILState_GetThisThreadState() argument
1451 if (gilstate->autoInterpreterState == NULL) in _PyGILState_GetThisThreadState()
1453 return (PyThreadState *)PyThread_tss_get(&gilstate->autoTSSkey); in _PyGILState_GetThisThreadState()
1459 return _PyGILState_GetThisThreadState(&_PyRuntime.gilstate); in PyGILState_GetThisThreadState()
1465 struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; in PyGILState_Check() local
1466 if (!gilstate->check_enabled) { in PyGILState_Check()
1470 if (!PyThread_tss_is_created(&gilstate->autoTSSkey)) { in PyGILState_Check()
1474 PyThreadState *tstate = _PyRuntimeGILState_GetThreadState(gilstate); in PyGILState_Check()
1479 return (tstate == _PyGILState_GetThisThreadState(gilstate)); in PyGILState_Check()
1486 struct _gilstate_runtime_state *gilstate = &runtime->gilstate; in PyGILState_Ensure() local
1498 assert(gilstate->autoInterpreterState); in PyGILState_Ensure()
1500 PyThreadState *tcur = (PyThreadState *)PyThread_tss_get(&gilstate->autoTSSkey); in PyGILState_Ensure()
1504 tcur = PyThreadState_New(gilstate->autoInterpreterState); in PyGILState_Ensure()
1536 PyThreadState *tstate = PyThread_tss_get(&runtime->gilstate.autoTSSkey); in PyGILState_Release()
1568 assert(_PyRuntimeGILState_GetThreadState(&runtime->gilstate) == tstate); in PyGILState_Release()
1674 _call_in_interpreter(struct _gilstate_runtime_state *gilstate, in _call_in_interpreter() argument
1683 if (interp != _PyRuntimeGILState_GetThreadState(gilstate)->interp) { in _call_in_interpreter()
1687 save_tstate = _PyThreadState_Swap(gilstate, tstate); in _call_in_interpreter()
1694 _PyThreadState_Swap(gilstate, save_tstate); in _call_in_interpreter()
1717 struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; in _PyCrossInterpreterData_Release() local
1718 _call_in_interpreter(gilstate, interp, _release_xidata, data); in _PyCrossInterpreterData_Release()