diff options
Diffstat (limited to '3rdParty/Boost/src/boost/asio/detail/impl/win_iocp_io_service.ipp')
-rw-r--r-- | 3rdParty/Boost/src/boost/asio/detail/impl/win_iocp_io_service.ipp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/3rdParty/Boost/src/boost/asio/detail/impl/win_iocp_io_service.ipp b/3rdParty/Boost/src/boost/asio/detail/impl/win_iocp_io_service.ipp index 9711702..4607669 100644 --- a/3rdParty/Boost/src/boost/asio/detail/impl/win_iocp_io_service.ipp +++ b/3rdParty/Boost/src/boost/asio/detail/impl/win_iocp_io_service.ipp @@ -70,6 +70,7 @@ win_iocp_io_service::win_iocp_io_service(boost::asio::io_service& io_service) shutdown_(0), dispatch_required_(0) { + BOOST_ASIO_HANDLER_TRACKING_INIT; } void win_iocp_io_service::init(size_t concurrency_hint) @@ -89,7 +90,7 @@ void win_iocp_io_service::shutdown_service() { ::InterlockedExchange(&shutdown_, 1); - if (timer_thread_) + if (timer_thread_.get()) { LARGE_INTEGER timeout; timeout.QuadPart = 1; @@ -125,7 +126,7 @@ void win_iocp_io_service::shutdown_service() } } - if (timer_thread_) + if (timer_thread_.get()) timer_thread_->join(); } @@ -262,6 +263,17 @@ void win_iocp_io_service::post_deferred_completions( } } +void win_iocp_io_service::abandon_operations( + op_queue<win_iocp_operation>& ops) +{ + while (win_iocp_operation* op = ops.front()) + { + ops.pop(); + ::InterlockedDecrement(&outstanding_work_); + op->destroy(); + } +} + void win_iocp_io_service::on_pending(win_iocp_operation* op) { if (::InterlockedCompareExchange(&op->ready_, 1, 0) == 1) @@ -455,7 +467,7 @@ void win_iocp_io_service::do_add_timer_queue(timer_queue_base& queue) &timeout, max_timeout_msec, 0, 0, FALSE); } - if (!timer_thread_) + if (!timer_thread_.get()) { timer_thread_function thread_function = { this }; timer_thread_.reset(new thread(thread_function, 65536)); @@ -471,7 +483,7 @@ void win_iocp_io_service::do_remove_timer_queue(timer_queue_base& queue) void win_iocp_io_service::update_timeout() { - if (timer_thread_) + if (timer_thread_.get()) { // There's no point updating the waitable timer if the new timeout period // exceeds the maximum timeout. In that case, we might as well wait for the |