]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/detail/impl/win_object_handle_service.ipp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / asio / detail / impl / win_object_handle_service.ipp
index db56f722f2fedfcf14b65382ed55358c8681094a..f356a0061341b6a8791bfbc39ded2117f4e5bf60 100644 (file)
@@ -2,7 +2,7 @@
 // detail/impl/win_object_handle_service.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2011 Boris Schaeling (boris@highscore.de)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -28,10 +28,9 @@ namespace boost {
 namespace asio {
 namespace detail {
 
-win_object_handle_service::win_object_handle_service(
-    boost::asio::io_context& io_context)
-  : service_base<win_object_handle_service>(io_context),
-    io_context_(boost::asio::use_service<io_context_impl>(io_context)),
+win_object_handle_service::win_object_handle_service(execution_context& context)
+  : execution_context_service_base<win_object_handle_service>(context),
+    scheduler_(boost::asio::use_service<scheduler_impl>(context)),
     mutex_(),
     impl_list_(0),
     shutdown_(false)
@@ -53,7 +52,7 @@ void win_object_handle_service::shutdown()
 
   lock.unlock();
 
-  io_context_.abandon_operations(ops);
+  scheduler_.abandon_operations(ops);
 }
 
 void win_object_handle_service::construct(
@@ -179,7 +178,7 @@ void win_object_handle_service::destroy(
 
   if (is_open(impl))
   {
-    BOOST_ASIO_HANDLER_OPERATION((io_context_.context(), "object_handle",
+    BOOST_ASIO_HANDLER_OPERATION((scheduler_.context(), "object_handle",
           &impl, reinterpret_cast<uintmax_t>(impl.wait_handle_), "close"));
 
     HANDLE wait_handle = impl.wait_handle_;
@@ -204,7 +203,7 @@ void win_object_handle_service::destroy(
     ::CloseHandle(impl.handle_);
     impl.handle_ = INVALID_HANDLE_VALUE;
 
-    io_context_.post_deferred_completions(ops);
+    scheduler_.post_deferred_completions(ops);
   }
 }
 
@@ -229,7 +228,7 @@ boost::system::error_code win_object_handle_service::close(
 {
   if (is_open(impl))
   {
-    BOOST_ASIO_HANDLER_OPERATION((io_context_.context(), "object_handle",
+    BOOST_ASIO_HANDLER_OPERATION((scheduler_.context(), "object_handle",
           &impl, reinterpret_cast<uintmax_t>(impl.wait_handle_), "close"));
 
     mutex::scoped_lock lock(mutex_);
@@ -265,7 +264,7 @@ boost::system::error_code win_object_handle_service::close(
           boost::asio::error::get_system_category());
     }
 
-    io_context_.post_deferred_completions(completed_ops);
+    scheduler_.post_deferred_completions(completed_ops);
   }
   else
   {
@@ -281,7 +280,7 @@ boost::system::error_code win_object_handle_service::cancel(
 {
   if (is_open(impl))
   {
-    BOOST_ASIO_HANDLER_OPERATION((io_context_.context(), "object_handle",
+    BOOST_ASIO_HANDLER_OPERATION((scheduler_.context(), "object_handle",
           &impl, reinterpret_cast<uintmax_t>(impl.wait_handle_), "cancel"));
 
     mutex::scoped_lock lock(mutex_);
@@ -307,7 +306,7 @@ boost::system::error_code win_object_handle_service::cancel(
 
     ec = boost::system::error_code();
 
-    io_context_.post_deferred_completions(completed_ops);
+    scheduler_.post_deferred_completions(completed_ops);
   }
   else
   {
@@ -341,7 +340,7 @@ void win_object_handle_service::wait(
 void win_object_handle_service::start_wait_op(
     win_object_handle_service::implementation_type& impl, wait_op* op)
 {
-  io_context_.work_started();
+  scheduler_.work_started();
 
   if (is_open(impl))
   {
@@ -359,13 +358,13 @@ void win_object_handle_service::start_wait_op(
     else
     {
       lock.unlock();
-      io_context_.post_deferred_completion(op);
+      scheduler_.post_deferred_completion(op);
     }
   }
   else
   {
     op->ec_ = boost::asio::error::bad_descriptor;
-    io_context_.post_deferred_completion(op);
+    scheduler_.post_deferred_completion(op);
   }
 }
 
@@ -392,7 +391,7 @@ void win_object_handle_service::register_wait_callback(
     }
 
     lock.unlock();
-    io_context_.post_deferred_completions(completed_ops);
+    scheduler_.post_deferred_completions(completed_ops);
   }
 }
 
@@ -434,9 +433,9 @@ void win_object_handle_service::wait_callback(PVOID param, BOOLEAN)
       }
     }
 
-    io_context_impl& ioc = impl->owner_->io_context_;
+    scheduler_impl& sched = impl->owner_->scheduler_;
     lock.unlock();
-    ioc.post_deferred_completions(completed_ops);
+    sched.post_deferred_completions(completed_ops);
   }
 }