Suppose I have two coroutines, coroutine_a
and coroutine_b
. In coroutine_a
it calls:
co_await awaiter_a;
The awaiter_a::await_suspend
returns a coroutine handler of coroutine_b
. As a result, coroutine_b
is resumed. Then, in coroutine_b
, it calls:
co_await awaiter_b;
The awaiter_b::await_suspend
returns void. As a result, control should be returned to its caller/resumer coroutine_a
. What will happen when control is returned to coroutine_a
?
I think there are two options:
coroutine_a
returns to its caller.coroutine_a
stays suspended until someone resumes it.
Which one is correct? Or is it something else?
Pengtao is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.