[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 69c68de43a)

Co-authored-by: Ken Jin <kenjin@python.org>
This commit is contained in:
Miss Islington (bot) 2024-07-16 19:57:37 +02:00 committed by GitHub
parent 54db42fe2c
commit 06d76c4b94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 18 additions and 111 deletions

View file

@ -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);