// 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
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)
lock.unlock();
- io_context_.abandon_operations(ops);
+ scheduler_.abandon_operations(ops);
}
void win_object_handle_service::construct(
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_;
::CloseHandle(impl.handle_);
impl.handle_ = INVALID_HANDLE_VALUE;
- io_context_.post_deferred_completions(ops);
+ scheduler_.post_deferred_completions(ops);
}
}
{
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_);
boost::asio::error::get_system_category());
}
- io_context_.post_deferred_completions(completed_ops);
+ scheduler_.post_deferred_completions(completed_ops);
}
else
{
{
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_);
ec = boost::system::error_code();
- io_context_.post_deferred_completions(completed_ops);
+ scheduler_.post_deferred_completions(completed_ops);
}
else
{
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))
{
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);
}
}
}
lock.unlock();
- io_context_.post_deferred_completions(completed_ops);
+ scheduler_.post_deferred_completions(completed_ops);
}
}
}
}
- 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);
}
}