2
0
mirror of https://github.com/boostorg/asio.git synced 2026-02-24 02:12:12 +00:00
Christopher Kohlhoff 769dc0e149 Add this_coro::throw_if_cancelled.
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 ...
    }
2021-07-04 13:10:27 +10:00
2021-03-04 09:02:43 +11:00
2021-07-04 13:10:27 +10:00
2021-02-25 08:29:05 +11:00
2006-06-14 22:26:36 +00:00
2021-06-02 04:29:33 +03:00
Description
Mirrored via gitea-mirror
24 MiB
Languages
C++ 99.6%
HTML 0.2%
Perl 0.2%