static inline void tstate_deactivate(PyThreadState *tstate);
-static void tstate_set_detached(PyThreadState *tstate);
+static void tstate_set_detached(PyThreadState *tstate, int detached_state);
static void zapthreads(PyInterpreterState *interp);
void
#ifdef Py_GIL_DISABLED
_Py_qsbr_detach(((_PyThreadStateImpl *)tstate)->qsbr);
#endif
- tstate_set_detached(tstate);
+ tstate_set_detached(tstate, _Py_THREAD_DETACHED);
tstate_delete_common(tstate);
current_fast_clear(tstate->interp->runtime);
_PyEval_ReleaseLock(tstate->interp, NULL);
}
static void
-tstate_set_detached(PyThreadState *tstate)
+tstate_set_detached(PyThreadState *tstate, int detached_state)
{
assert(tstate->state == _Py_THREAD_ATTACHED);
#ifdef Py_GIL_DISABLED
- _Py_atomic_store_int(&tstate->state, _Py_THREAD_DETACHED);
+ _Py_atomic_store_int(&tstate->state, detached_state);
#else
- tstate->state = _Py_THREAD_DETACHED;
+ tstate->state = detached_state;
#endif
}
_Py_qsbr_detach(((_PyThreadStateImpl *)tstate)->qsbr);
#endif
tstate_deactivate(tstate);
- tstate_set_detached(tstate);
+ tstate_set_detached(tstate, detached_state);
current_fast_clear(&_PyRuntime);
_PyEval_ReleaseLock(tstate->interp, tstate);
}