logger_service(boost::asio::execution_context& context)
: boost::asio::execution_context::service(context),
work_io_context_(),
- work_(boost::asio::make_work_guard(work_io_context_)),
+ work_(boost::asio::require(work_io_context_.get_executor(),
+ boost::asio::execution::outstanding_work.tracked)),
work_thread_(new boost::thread(
boost::bind(&boost::asio::io_context::run, &work_io_context_)))
{
{
/// Indicate that we have finished with the private io_context. Its
/// io_context::run() function will exit once all other work has completed.
- work_.reset();
+ work_ = boost::asio::any_io_executor();
if (work_thread_)
work_thread_->join();
}
/// Private io_context used for performing logging operations.
boost::asio::io_context work_io_context_;
- /// Work for the private io_context to perform. If we do not give the
- /// io_context some work to do then the io_context::run() function will exit
- /// immediately.
- boost::asio::executor_work_guard<
- boost::asio::io_context::executor_type> work_;
+ /// A work-tracking executor giving work for the private io_context to
+ /// perform. If we do not give the io_context some work to do then the
+ /// io_context::run() function will exit immediately.
+ boost::asio::any_io_executor work_;
/// Thread used for running the work io_context's run loop.
boost::scoped_ptr<boost::thread> work_thread_;