capy::task<void> set_event(capy::async_event& evt)
{
evt.set();
co_return;
}
capy::task<void> co_main()
{
capy::async_event evt;
co_await capy::when_all(evt.wait(), set_event(evt));
std::cout << "Finished\n";
}
int main()
{
corosio::io_context ctx;
capy::run_async(ctx.get_executor())(co_main());
ctx.run();
}
Expected: the program finishes immediately
Actual: the program hangs forever