mirror of
https://github.com/boostorg/asio.git
synced 2026-02-24 02:12:12 +00:00
769dc0e1497b925e8c47a09b3ec527734c253cba
By default, awaitable<>-based coroutines now throw an exception if they
have been previously cancelled, and then try to perform a co_await
against another awaitable<>.
To disable this behaviour for the current awaitable<>-based "thread",
perform:
co_await boost::asio::this_coro::throw_if_error(false);
It is then the responsibility of the coroutine implementation to ensure
that it checks the cancellation state of the coroutine manually, by
doing something like:
auto cs = boost::asio::this_coro::cancellation_state;
// ...
if (cs.cancelled() != cancellation_type::none)
{
// ... handle cancellation ...
}
Description
Mirrored via gitea-mirror
Languages
C++
99.6%
HTML
0.2%
Perl
0.2%