summaryrefslogtreecommitdiffstats
path: root/Modules/_asynciomodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_asynciomodule.c')
-rw-r--r--Modules/_asynciomodule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c
index 1092b08..c10866a 100644
--- a/Modules/_asynciomodule.c
+++ b/Modules/_asynciomodule.c
@@ -231,7 +231,8 @@ get_running_loop(PyObject **loop)
PyObject *rl;
PyThreadState *ts = PyThreadState_Get();
- if (ts->id == cached_running_holder_tsid && cached_running_holder != NULL) {
+ uint64_t ts_id = PyThreadState_GetID(ts);
+ if (ts_id == cached_running_holder_tsid && cached_running_holder != NULL) {
// Fast path, check the cache.
rl = cached_running_holder; // borrowed
}
@@ -253,7 +254,7 @@ get_running_loop(PyObject **loop)
}
cached_running_holder = rl; // borrowed
- cached_running_holder_tsid = ts->id;
+ cached_running_holder_tsid = ts_id;
}
assert(Py_IS_TYPE(rl, &PyRunningLoopHolder_Type));