diff options
Diffstat (limited to '3rdparty/asio/include/asio/detail/kqueue_reactor.hpp')
-rw-r--r-- | 3rdparty/asio/include/asio/detail/kqueue_reactor.hpp | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/3rdparty/asio/include/asio/detail/kqueue_reactor.hpp b/3rdparty/asio/include/asio/detail/kqueue_reactor.hpp index 8d1c66737d5..645f1221cd8 100644 --- a/3rdparty/asio/include/asio/detail/kqueue_reactor.hpp +++ b/3rdparty/asio/include/asio/detail/kqueue_reactor.hpp @@ -2,7 +2,7 @@ // detail/kqueue_reactor.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2005 Stefan Arentz (stefan at soze dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -24,8 +24,8 @@ #include <sys/types.h> #include <sys/event.h> #include <sys/time.h> +#include "asio/detail/conditionally_enabled_mutex.hpp" #include "asio/detail/limits.hpp" -#include "asio/detail/mutex.hpp" #include "asio/detail/object_pool.hpp" #include "asio/detail/op_queue.hpp" #include "asio/detail/reactor_op.hpp" @@ -114,10 +114,7 @@ public: per_descriptor_data& source_descriptor_data); // Post a reactor operation for immediate completion. - void post_immediate_completion(reactor_op* op, bool is_continuation) - { - scheduler_.post_immediate_completion(op, is_continuation); - } + void post_immediate_completion(operation* op, bool is_continuation); // Start a new operation. The reactor operation will be performed when the // given descriptor is flagged as ready, or an error has occurred. @@ -131,15 +128,30 @@ public: ASIO_DECL void cancel_ops(socket_type descriptor, per_descriptor_data& descriptor_data); + // Cancel all operations associated with the given descriptor and key. The + // handlers associated with the descriptor will be invoked with the + // operation_aborted error. + ASIO_DECL void cancel_ops_by_key(socket_type descriptor, + per_descriptor_data& descriptor_data, + int op_type, void* cancellation_key); + // Cancel any operations that are running against the descriptor and remove - // its registration from the reactor. + // its registration from the reactor. The reactor resources associated with + // the descriptor must be released by calling cleanup_descriptor_data. ASIO_DECL void deregister_descriptor(socket_type descriptor, per_descriptor_data& descriptor_data, bool closing); - // Remote the descriptor's registration from the reactor. + // Remove the descriptor's registration from the reactor. The reactor + // resources associated with the descriptor must be released by calling + // cleanup_descriptor_data. ASIO_DECL void deregister_internal_descriptor( socket_type descriptor, per_descriptor_data& descriptor_data); + // Perform any post-deregistration cleanup tasks associated with the + // descriptor data. + ASIO_DECL void cleanup_descriptor_data( + per_descriptor_data& descriptor_data); + // Add a new timer queue to the reactor. template <typename Time_Traits> void add_timer_queue(timer_queue<Time_Traits>& queue); @@ -162,6 +174,12 @@ public: typename timer_queue<Time_Traits>::per_timer_data& timer, std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)()); + // Cancel the timer operations associated with the given key. + template <typename Time_Traits> + void cancel_timer_by_key(timer_queue<Time_Traits>& queue, + typename timer_queue<Time_Traits>::per_timer_data* timer, + void* cancellation_key); + // Move the timer operations associated with the given timer. template <typename Time_Traits> void move_timer(timer_queue<Time_Traits>& queue, |