[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

@ -68,6 +68,8 @@ struct _ts {
pycore_ceval.h. */
uintptr_t eval_breaker;
PyObject *asyncio_running_loop; // Strong reference
struct {
/* Has been initialized to a safe state.

View file

@ -586,7 +586,6 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(__anext__));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(__annotations__));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(__args__));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(__asyncio_running_event_loop__));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(__await__));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(__bases__));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(__bool__));

View file

@ -75,7 +75,6 @@ struct _Py_global_strings {
STRUCT_FOR_ID(__anext__)
STRUCT_FOR_ID(__annotations__)
STRUCT_FOR_ID(__args__)
STRUCT_FOR_ID(__asyncio_running_event_loop__)
STRUCT_FOR_ID(__await__)
STRUCT_FOR_ID(__bases__)
STRUCT_FOR_ID(__bool__)

View file

@ -584,7 +584,6 @@ extern "C" {
INIT_ID(__anext__), \
INIT_ID(__annotations__), \
INIT_ID(__args__), \
INIT_ID(__asyncio_running_event_loop__), \
INIT_ID(__await__), \
INIT_ID(__bases__), \
INIT_ID(__bool__), \

View file

@ -104,10 +104,6 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) {
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
assert(PyUnicode_GET_LENGTH(string) != 1);
string = &_Py_ID(__asyncio_running_event_loop__);
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
assert(PyUnicode_GET_LENGTH(string) != 1);
string = &_Py_ID(__await__);
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));