10000 GH-117881: fix athrow().throw()/asend().throw() concurrent access by graingert · Pull Request #117882 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-117881: fix athrow().throw()/asend().throw() concurrent access #117882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Prev Previous commit
Next Next commit
set ag_running_async = 1 when calling async_gen_athrow_throw or async…
…_gen_send_throw
  • Loading branch information
graingert authored Apr 15, 2024
commit 38b8246415f9f7323368ac633a1c3d32f282f41b
2 changes: 2 additions & 0 deletions Objects/genobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1825,6 +1825,7 @@ async_gen_asend_throw(PyAsyncGenASend *o, PyObject *const *args, Py_ssize_t narg
}

o->ags_state = AWAITABLE_STATE_ITER;
o->ags_gen->ag_running_async = 1;
}

result = gen_throw((PyGenObject*)o->ags_gen, args, nargs);
Expand Down Expand Up @@ -2237,6 +2238,7 @@ async_gen_athrow_throw(PyAsyncGenAThrow *o, PyObject *const *args, Py_ssize_t na
}

o->agt_state = AWAITABLE_STATE_ITER;
o->agt_gen->ag_running_async = 1;
}

retval = gen_throw((PyGenObject*)o->agt_gen, args, nargs);
Expand Down
0