Skip to content

Instantly share code, notes, and snippets.

@eahydra
Last active December 15, 2015 09:59
Show Gist options
  • Save eahydra/5242734 to your computer and use it in GitHub Desktop.
Save eahydra/5242734 to your computer and use it in GitHub Desktop.
void coroutine_executor() {
reenter(this) {
std::cout<<"before yield 1"<<std::endl;
yield task_thread_pool_.post_task([&](){
std::cout<<"yield 1"<<std::endl;
coroutine_executor();
});
std::cout<<"after yield 1"<<std::endl;
yield task_thread_pool_.post_task([&](){
std::cout<<"yield 2"<<std::endl;
coroutine_executor();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment