summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-07-16 17:57:37 (GMT)
committerGitHub <noreply@github.com>2024-07-16 17:57:37 (GMT)
commit06d76c4b94f87b0785a96dbfa0904afc0b459cb7 (patch)
tree4cdab1248456832a3609acd02a0583523337160e /Python
parent54db42fe2ca6b6cbbed84499627064367869e6cb (diff)
downloadcpython-06d76c4b94f87b0785a96dbfa0904afc0b459cb7.zip
cpython-06d76c4b94f87b0785a96dbfa0904afc0b459cb7.tar.gz
cpython-06d76c4b94f87b0785a96dbfa0904afc0b459cb7.tar.bz2
[3.13] gh-121621: Move asyncio running loop to thread state (GH-121695) (GH-121864)
gh-121621: Move asyncio running loop to thread state (GH-121695) (cherry picked from commit 69c68de43aef03dd52fabd21f99cb3b0f9329201) Co-authored-by: Ken Jin <kenjin@python.org>
Diffstat (limited to 'Python')
-rw-r--r--Python/pystate.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 602b13e..f77a2cc 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -1499,6 +1499,8 @@ init_threadstate(_PyThreadStateImpl *_tstate,
tstate->previous_executor = NULL;
tstate->dict_global_version = 0;
+ tstate->asyncio_running_loop = NULL;
+
tstate->delete_later = NULL;
llist_init(&_tstate->mem_free_queue);
@@ -1700,6 +1702,8 @@ PyThreadState_Clear(PyThreadState *tstate)
/* Don't clear tstate->pyframe: it is a borrowed reference */
+ Py_CLEAR(tstate->asyncio_running_loop);
+
Py_CLEAR(tstate->dict);
Py_CLEAR(tstate->async_exc);