Lines Matching defs:tstate

147          PyThreadState *tstate)
154 /* tstate is allowed to be NULL (early interpreter init) */
155 if (tstate != NULL) {
159 _Py_atomic_store_relaxed(&gil->last_holder, (uintptr_t)tstate);
169 if (_Py_atomic_load_relaxed(&ceval2->gil_drop_request) && tstate != NULL) {
172 if (((PyThreadState*)_Py_atomic_load_relaxed(&gil->last_holder)) == tstate)
174 assert(is_tstate_valid(tstate));
175 RESET_GIL_DROP_REQUEST(tstate->interp);
194 tstate must be non-NULL. */
196 tstate_must_exit(PyThreadState *tstate)
199 tstate->interp->runtime to support calls from Python daemon threads.
200 After Py_Finalize() has been called, tstate can be a dangling pointer:
203 return (finalizing != NULL && finalizing != tstate);
211 tstate must be non-NULL. */
213 take_gil(PyThreadState *tstate)
217 assert(tstate != NULL);
219 if (tstate_must_exit(tstate)) {
220 /* bpo-39877: If Py_Finalize() has been called and tstate is not the
224 completes. In this case, tstate is a dangling pointer: points to
229 assert(is_tstate_valid(tstate));
230 PyInterpreterState *interp = tstate->interp;
258 if (tstate_must_exit(tstate)) {
271 assert(is_tstate_valid(tstate));
288 if (tstate != (PyThreadState*)_Py_atomic_load_relaxed(&gil->last_holder)) {
289 _Py_atomic_store_relaxed(&gil->last_holder, (uintptr_t)tstate);
298 if (tstate_must_exit(tstate)) {
299 /* bpo-36475: If Py_Finalize() has been called and tstate is not
307 drop_gil(ceval, ceval2, tstate);
310 assert(is_tstate_valid(tstate));
324 /* Don't access tstate if the thread must exit */
325 if (tstate->async_exc != NULL) {
326 _PyEval_SignalAsyncExc(tstate->interp);