You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cppcoro::async_mutex mtx;
cppcoro::async_manual_reset_event event;
auto tsk = [&]()->cppcoro::task<>{
auto tsk_lock = [&]()->cppcoro::task<>{
cppcoro::async_mutex_lock lck = co_await mtx.scoped_lock_async();
co_await event;
};
/// terminate called after throwing an instance of 'cppcoro::broken_promise'what(): broken promise
auto tsk_unlock = [&]()->cppcoro::task<>{
event.set();
};
co_await cppcoro::when_all(tsk_lock(), tsk_unlock());
The text was updated successfully, but these errors were encountered:
bbqz007
changed the title
co_await under async_mutex protection, broken promise when unlock().
calling set() to cppcoro::async_manual_reset_event in coroutine, throw broken promise
Dec 24, 2024
the problem is that
there is no co_return in a the coro code.
the compiler did not make error even though i did not write the co_return.
in most cases, if my coro code ends with co_await, the code even run ok.
that make me have a wrong idea that there is not need a co_return; if task。
The text was updated successfully, but these errors were encountered: