Skip to content

Commit 3052330

Browse files
cleanup
1 parent 28735e7 commit 3052330

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Include/internal/pycore_lock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ typedef enum _PyLockFlags {
5252

5353
// Lock a mutex with an optional timeout and additional options. See
5454
// _PyLockFlags for details.
55-
extern PyLockStatus
55+
extern PyAPI_FUNC(PyLockStatus)
5656
_PyMutex_LockTimed(PyMutex *m, PyTime_t timeout_ns, _PyLockFlags flags);
5757

5858
// Lock a mutex with additional options. See _PyLockFlags for details.

Modules/_asynciomodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3750,9 +3750,9 @@ _asyncio_all_tasks_impl(PyObject *module, PyObject *loop)
37503750
struct llist_node *node;
37513751
PyInterpreterState *interp = PyInterpreterState_Get();
37523752
_PyEval_StopTheWorld(interp);
3753-
_PyThreadStateImpl *ts = (_PyThreadStateImpl *)PyInterpreterState_ThreadHead(interp);
3754-
while (ts) {
3755-
struct llist_node *head = &ts->asyncio_tasks_head;
3753+
_Py_FOR_EACH_TSTATE_BEGIN(interp, p) {
3754+
_PyThreadStateImpl *tstate = (_PyThreadStateImpl *)p;
3755+
struct llist_node *head = &tstate->asyncio_tasks_head;
37563756
llist_for_each_safe(node, head) {
37573757
TaskObj *task = llist_data(node, TaskObj, task_node);
37583758
// The linked list holds borrowed references to task
@@ -3771,8 +3771,8 @@ _asyncio_all_tasks_impl(PyObject *module, PyObject *loop)
37713771
}
37723772
}
37733773
}
3774-
ts = (_PyThreadStateImpl *)ts->base.next;
37753774
}
3775+
_Py_FOR_EACH_TSTATE_END(interp);
37763776
_PyEval_StartTheWorld(interp);
37773777
if (err) {
37783778
return NULL;

0 commit comments

Comments
 (0)