]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/asio/example/cpp03/services/logger_service.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / asio / example / cpp03 / services / logger_service.hpp
index 4f439c5e1f1fc5707e360ed29f0b57d7e1546d80..4db34efc1645ef51a4224116c4d701a13073b7fd 100644 (file)
@@ -45,7 +45,8 @@ public:
   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_)))
   {
@@ -56,7 +57,7 @@ public:
   {
     /// 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();
   }
@@ -128,11 +129,10 @@ private:
   /// 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_;