Examples require tracked

This commit is contained in:
Richard Hodges
2020-07-04 08:22:39 +02:00
parent de1e63c597
commit a9b5bf343d
5 changed files with 6 additions and 5 deletions

View File

@ -358,7 +358,7 @@ int main(int argc, char* argv[])
// Building a tracked executor ensures that the underlying context's
// run() function will not return until the tracked executor is destroyed
net::any_io_executor work =
net::prefer(
net::require(
ioc.get_executor(),
net::execution::outstanding_work.tracked);

View File

@ -85,7 +85,8 @@ public:
std::ostream& log,
kind k = kind::sync)
: log_(log)
, work_(net::prefer(ioc_.get_executor(), net::execution::outstanding_work.tracked))
, work_(net::require(ioc_.get_executor(),
net::execution::outstanding_work.tracked))
, ts_(ioc_)
, ws_(ts_)
{

View File

@ -39,7 +39,7 @@ using tcp = net::ip::tcp;
net::io_context ioc;
net::any_io_executor work =
net::prefer(ioc.get_executor(),
net::require(ioc.get_executor(),
net::execution::outstanding_work.tracked);
std::thread t{[&](){ ioc.run(); }};

View File

@ -38,7 +38,7 @@ void fxx() {
net::io_context ioc;
net::any_io_executor work =
net::prefer(
net::require(
ioc.get_executor(),
net::execution::outstanding_work.tracked);
std::thread t{[&](){ ioc.run(); }};

View File

@ -18,7 +18,7 @@ using tcp = net::ip::tcp;
error_code ec;
net::io_context ioc;
net::any_io_executor work =
net::prefer(
net::require(
ioc.get_executor(),
net::execution::outstanding_work.tracked);
std::thread t{[&](){ ioc.run(); }};