2
0
mirror of https://github.com/boostorg/asio.git synced 2026-01-19 16:12:09 +00:00
Files
asio/example/cpp11
Christopher Kohlhoff fefe9a992e Use properties to track outstanding work against an io_context.
When using standard executors, work is tracked by requiring (or
preferring) an executor with the execution::outstanding_work.tracked
property. This replaces executor_work_guard and make_work_guard() with
code of the form

    asio::io_context io_context;
    auto work = asio::require(io_context.get_executor(),
        asio::execution::outstanding_work.tracked);

To explicitly reset work, store the returned work-tracking executor in
an any_io_executor object:

    asio::any_io_executor work
      = asio::require(io_context.get_executor(),
          asio::execution::outstanding_work.tracked);

and then assign an empty executor into the object when done:

    work = asio::any_io_executor();
2020-06-23 11:08:25 +10:00
..
2020-04-07 11:15:42 +10:00
2020-04-07 11:15:42 +10:00
2020-04-07 11:15:42 +10:00
2020-04-07 11:15:42 +10:00
2020-04-07 11:15:42 +10:00
2020-04-07 11:15:42 +10:00
2020-04-07 11:15:42 +10:00
2020-04-07 11:15:42 +10:00
2020-04-07 11:15:42 +10:00
2020-04-07 11:15:42 +10:00
2020-04-07 11:15:42 +10:00
2020-04-07 11:15:42 +10:00
2020-04-07 11:15:42 +10:00
2020-04-07 11:15:42 +10:00