-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
修正嵌套的 asio 协程内部启动的 ucoro 协程无法再调用 asio 协程的错误
ucoro 协程能调用 asio 协程的关键是, local_storage 绑定了一个 io_context 但是,在 asio 协程里,再次等待 ucoro 协程的时候,此时的 ucoro 协程却失去了 io_context 因此,这个嵌套在里面的 ucoro 就无法再调用 asio 的协程了。 解决的办法是把 executor 作为参数继续传下去,在 initiate_do_invoke_ucoro_awaitable 里面调用 ucoro 的 detach() 方法时,把 executor 传进去。
- Loading branch information
Showing
2 changed files
with
7 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters