Lines Matching refs:tstate

53 static void _PyGILState_NoteThreadState(PyThreadState* tstate);
159 PyThreadState *tstate = (PyThreadState *)malloc(sizeof(PyThreadState)); in new_threadstate() local
164 if (tstate != NULL) { in new_threadstate()
165 tstate->interp = interp; in new_threadstate()
167 tstate->frame = NULL; in new_threadstate()
168 tstate->recursion_depth = 0; in new_threadstate()
169 tstate->tracing = 0; in new_threadstate()
170 tstate->use_tracing = 0; in new_threadstate()
171 tstate->tick_counter = 0; in new_threadstate()
172 tstate->gilstate_counter = 0; in new_threadstate()
173 tstate->async_exc = NULL; in new_threadstate()
175 tstate->thread_id = PyThread_get_thread_ident(); in new_threadstate()
177 tstate->thread_id = 0; in new_threadstate()
180 tstate->dict = NULL; in new_threadstate()
182 tstate->curexc_type = NULL; in new_threadstate()
183 tstate->curexc_value = NULL; in new_threadstate()
184 tstate->curexc_traceback = NULL; in new_threadstate()
186 tstate->exc_type = NULL; in new_threadstate()
187 tstate->exc_value = NULL; in new_threadstate()
188 tstate->exc_traceback = NULL; in new_threadstate()
190 tstate->c_profilefunc = NULL; in new_threadstate()
191 tstate->c_tracefunc = NULL; in new_threadstate()
192 tstate->c_profileobj = NULL; in new_threadstate()
193 tstate->c_traceobj = NULL; in new_threadstate()
195 tstate->trash_delete_nesting = 0; in new_threadstate()
196 tstate->trash_delete_later = NULL; in new_threadstate()
199 _PyThreadState_Init(tstate); in new_threadstate()
202 tstate->next = interp->tstate_head; in new_threadstate()
203 interp->tstate_head = tstate; in new_threadstate()
207 return tstate; in new_threadstate()
223 _PyThreadState_Init(PyThreadState *tstate) in _PyThreadState_Init() argument
226 _PyGILState_NoteThreadState(tstate); in _PyThreadState_Init()
231 PyThreadState_Clear(PyThreadState *tstate) in PyThreadState_Clear() argument
233 if (Py_VerboseFlag && tstate->frame != NULL) in PyThreadState_Clear()
237 Py_CLEAR(tstate->frame); in PyThreadState_Clear()
239 Py_CLEAR(tstate->dict); in PyThreadState_Clear()
240 Py_CLEAR(tstate->async_exc); in PyThreadState_Clear()
242 Py_CLEAR(tstate->curexc_type); in PyThreadState_Clear()
243 Py_CLEAR(tstate->curexc_value); in PyThreadState_Clear()
244 Py_CLEAR(tstate->curexc_traceback); in PyThreadState_Clear()
246 Py_CLEAR(tstate->exc_type); in PyThreadState_Clear()
247 Py_CLEAR(tstate->exc_value); in PyThreadState_Clear()
248 Py_CLEAR(tstate->exc_traceback); in PyThreadState_Clear()
250 tstate->c_profilefunc = NULL; in PyThreadState_Clear()
251 tstate->c_tracefunc = NULL; in PyThreadState_Clear()
252 Py_CLEAR(tstate->c_profileobj); in PyThreadState_Clear()
253 Py_CLEAR(tstate->c_traceobj); in PyThreadState_Clear()
259 tstate_delete_common(PyThreadState *tstate) in tstate_delete_common() argument
264 if (tstate == NULL) in tstate_delete_common()
266 interp = tstate->interp; in tstate_delete_common()
274 if (*p == tstate) in tstate_delete_common()
290 *p = tstate->next; in tstate_delete_common()
292 free(tstate); in tstate_delete_common()
297 PyThreadState_Delete(PyThreadState *tstate) in PyThreadState_Delete() argument
299 if (tstate == _PyThreadState_Current) in PyThreadState_Delete()
301 tstate_delete_common(tstate); in PyThreadState_Delete()
303 if (autoInterpreterState && PyThread_get_key_value(autoTLSkey) == tstate) in PyThreadState_Delete()
313 PyThreadState *tstate = _PyThreadState_Current; in PyThreadState_DeleteCurrent() local
314 if (tstate == NULL) in PyThreadState_DeleteCurrent()
318 if (autoInterpreterState && PyThread_get_key_value(autoTLSkey) == tstate) in PyThreadState_DeleteCurrent()
320 tstate_delete_common(tstate); in PyThreadState_DeleteCurrent()
393 PyThreadState *tstate = PyThreadState_GET(); in PyThreadState_SetAsyncExc() local
394 PyInterpreterState *interp = tstate->interp; in PyThreadState_SetAsyncExc()
446 PyThreadState_Next(PyThreadState *tstate) { in PyThreadState_Next() argument
447 return tstate->next; in PyThreadState_Next()
510 PyThreadState_IsCurrent(PyThreadState *tstate) in PyThreadState_IsCurrent() argument
513 assert(PyGILState_GetThisThreadState()==tstate); in PyThreadState_IsCurrent()
517 return tstate == _PyThreadState_Current; in PyThreadState_IsCurrent()
548 _PyGILState_NoteThreadState(PyThreadState* tstate) in _PyGILState_NoteThreadState() argument
570 if (PyThread_set_key_value(autoTLSkey, (void *)tstate) < 0) in _PyGILState_NoteThreadState()
574 tstate->gilstate_counter = 1; in _PyGILState_NoteThreadState()