Skip to content

Commit 1afac5f

Browse files
fix FutureIter_am_send_lock_held
1 parent 5411a44 commit 1afac5f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Modules/_asynciomodule.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,9 +1655,7 @@ FutureIter_dealloc(futureiterobject *it)
16551655
}
16561656

16571657
static PySendResult
1658-
FutureIter_am_send_lock_held(futureiterobject *it,
1659-
PyObject *Py_UNUSED(arg),
1660-
PyObject **result)
1658+
FutureIter_am_send_lock_held(futureiterobject *it, PyObject **result)
16611659
{
16621660
/* arg is unused, see the comment on FutureIter_send for clarification */
16631661

@@ -1681,7 +1679,9 @@ FutureIter_am_send_lock_held(futureiterobject *it,
16811679
}
16821680

16831681
it->future = NULL;
1682+
Py_BEGIN_CRITICAL_SECTION(fut);
16841683
res = _asyncio_Future_result_impl(fut);
1684+
Py_END_CRITICAL_SECTION();
16851685
if (res != NULL) {
16861686
Py_DECREF(fut);
16871687
*result = res;
@@ -1698,9 +1698,9 @@ FutureIter_am_send(futureiterobject *it,
16981698
PyObject **result)
16991699
{
17001700
PySendResult res;
1701-
Py_BEGIN_CRITICAL_SECTION2(it, it->future);
1702-
res = FutureIter_am_send_lock_held(it, Py_None, result);
1703-
Py_END_CRITICAL_SECTION2();
1701+
Py_BEGIN_CRITICAL_SECTION(it);
1702+
res = FutureIter_am_send_lock_held(it, result);
1703+
Py_END_CRITICAL_SECTION();
17041704
return res;
17051705
}
17061706

0 commit comments

Comments
 (0)