// semi-public fields are in PyThreadState.
PyThreadState base;
+ PyObject *asyncio_running_loop; // Strong reference
+
struct _qsbr_thread_state *qsbr; // only used by free-threaded build
struct llist_node mem_free_queue; // delayed free queue
PyObject *loop;
PyObject *policy;
- PyThreadState *ts = _PyThreadState_GET();
+ _PyThreadStateImpl *ts = (_PyThreadStateImpl *)_PyThreadState_GET();
loop = Py_XNewRef(ts->asyncio_running_loop);
if (loop != NULL) {
_asyncio__get_running_loop_impl(PyObject *module)
/*[clinic end generated code: output=b4390af721411a0a input=0a21627e25a4bd43]*/
{
- PyThreadState *ts = _PyThreadState_GET();
+ _PyThreadStateImpl *ts = (_PyThreadStateImpl *)_PyThreadState_GET();
PyObject *loop = Py_XNewRef(ts->asyncio_running_loop);
if (loop == NULL) {
/* There's no currently running event loop */
_asyncio__set_running_loop(PyObject *module, PyObject *loop)
/*[clinic end generated code: output=ae56bf7a28ca189a input=4c9720233d606604]*/
{
- PyThreadState *ts = _PyThreadState_GET();
+ _PyThreadStateImpl *ts = (_PyThreadStateImpl *)_PyThreadState_GET();
if (loop == Py_None) {
loop = NULL;
}
/*[clinic end generated code: output=c247b5f9e529530e input=2a3bf02ba39f173d]*/
{
PyObject *loop;
- PyThreadState *ts = _PyThreadState_GET();
+ _PyThreadStateImpl *ts = (_PyThreadStateImpl *)_PyThreadState_GET();
loop = Py_XNewRef(ts->asyncio_running_loop);
if (loop == NULL) {
/* There's no currently running event loop */
tstate->previous_executor = NULL;
tstate->dict_global_version = 0;
- tstate->asyncio_running_loop = NULL;
+ _tstate->asyncio_running_loop = NULL;
tstate->delete_later = NULL;
/* Don't clear tstate->pyframe: it is a borrowed reference */
- Py_CLEAR(tstate->asyncio_running_loop);
+ Py_CLEAR(((_PyThreadStateImpl *)tstate)->asyncio_running_loop);
Py_CLEAR(tstate->dict);
Py_CLEAR(tstate->async_exc);