Skip to content

Commit 6a9f478

Browse files
ambvkumaraditya303
andauthored
Update _asynciomodule.c
Co-authored-by: Kumar Aditya <[email protected]>
1 parent 975cfa7 commit 6a9f478

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Modules/_asynciomodule.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2324,7 +2324,6 @@ swap_current_task(asyncio_state *state, PyObject *loop, PyObject *task)
23242324
static inline void
23252325
set_ts_asyncio_running_task(PyObject *loop, PyObject *task)
23262326
{
2327-
// This is needed to enable `asyncio.capture_call_graph()` API.
23282327
// We want to be enable debuggers and profilers to be able to quickly
23292328
// introspect the asyncio running state from another process.
23302329
// When we do that, we need to essentially traverse the address space
@@ -2341,8 +2340,8 @@ set_ts_asyncio_running_task(PyObject *loop, PyObject *task)
23412340
// and ever-changing data structure.
23422341
//
23432342
// So the easier solution is to put a strong reference to the currently
2344-
// running `asyncio.Task` on the interpreter thread state (we already
2345-
// have some asyncio state there.)
2343+
// running `asyncio.Task` on the current thread state (the current loop
2344+
// is also stored there.)
23462345
_PyThreadStateImpl *ts = (_PyThreadStateImpl *)_PyThreadState_GET();
23472346
if (ts->asyncio_running_loop == loop) {
23482347
// Protect from a situation when someone calls this method

0 commit comments

Comments
 (0)