diff --git a/example/http/client/crawl/http_crawl.cpp b/example/http/client/crawl/http_crawl.cpp index a6fc4eba..5a621d14 100644 --- a/example/http/client/crawl/http_crawl.cpp +++ b/example/http/client/crawl/http_crawl.cpp @@ -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); diff --git a/test/beast/websocket/test.hpp b/test/beast/websocket/test.hpp index b202d67b..1575db32 100644 --- a/test/beast/websocket/test.hpp +++ b/test/beast/websocket/test.hpp @@ -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_) { diff --git a/test/doc/core_snippets.cpp b/test/doc/core_snippets.cpp index eb52e70f..50dcf49e 100644 --- a/test/doc/core_snippets.cpp +++ b/test/doc/core_snippets.cpp @@ -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(); }}; diff --git a/test/doc/http_snippets.cpp b/test/doc/http_snippets.cpp index 7f33626a..b3ac3255 100644 --- a/test/doc/http_snippets.cpp +++ b/test/doc/http_snippets.cpp @@ -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(); }}; diff --git a/test/doc/snippets.ipp b/test/doc/snippets.ipp index b6d2b74f..c96efc71 100644 --- a/test/doc/snippets.ipp +++ b/test/doc/snippets.ipp @@ -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(); }};