Просмотр исходного кода

Update contrib/restricted/boost/asio to 1.83.0
commit_hash:446591731b6d2e1a84e00faebd59f2706866b6e1

thegeorg 4 месяцев назад
Родитель
Сommit
d79b57a946

+ 61 - 0
contrib/restricted/boost/asio/include/boost/asio/any_completion_handler.hpp

@@ -23,9 +23,11 @@
 #include <memory>
 #include <memory>
 #include <utility>
 #include <utility>
 #include <boost/asio/any_completion_executor.hpp>
 #include <boost/asio/any_completion_executor.hpp>
+#include <boost/asio/any_io_executor.hpp>
 #include <boost/asio/associated_allocator.hpp>
 #include <boost/asio/associated_allocator.hpp>
 #include <boost/asio/associated_cancellation_slot.hpp>
 #include <boost/asio/associated_cancellation_slot.hpp>
 #include <boost/asio/associated_executor.hpp>
 #include <boost/asio/associated_executor.hpp>
+#include <boost/asio/associated_immediate_executor.hpp>
 #include <boost/asio/cancellation_state.hpp>
 #include <boost/asio/cancellation_state.hpp>
 #include <boost/asio/recycling_allocator.hpp>
 #include <boost/asio/recycling_allocator.hpp>
 
 
@@ -126,6 +128,13 @@ public:
         (get_associated_executor)(handler_, candidate));
         (get_associated_executor)(handler_, candidate));
   }
   }
 
 
+  any_completion_executor immediate_executor(
+      const any_io_executor& candidate) const BOOST_ASIO_NOEXCEPT
+  {
+    return any_completion_executor(std::nothrow,
+        (get_associated_immediate_executor)(handler_, candidate));
+  }
+
   void* allocate(std::size_t size, std::size_t align) const
   void* allocate(std::size_t size, std::size_t align) const
   {
   {
     typename std::allocator_traits<
     typename std::allocator_traits<
@@ -306,6 +315,36 @@ private:
   type executor_fn_;
   type executor_fn_;
 };
 };
 
 
+class any_completion_handler_immediate_executor_fn
+{
+public:
+  using type = any_completion_executor(*)(
+      any_completion_handler_impl_base*, const any_io_executor&);
+
+  constexpr any_completion_handler_immediate_executor_fn(type fn)
+    : immediate_executor_fn_(fn)
+  {
+  }
+
+  any_completion_executor immediate_executor(
+      any_completion_handler_impl_base* impl,
+      const any_io_executor& candidate) const
+  {
+    return immediate_executor_fn_(impl, candidate);
+  }
+
+  template <typename Handler>
+  static any_completion_executor impl(any_completion_handler_impl_base* impl,
+      const any_io_executor& candidate)
+  {
+    return static_cast<any_completion_handler_impl<Handler>*>(
+        impl)->immediate_executor(candidate);
+  }
+
+private:
+  type immediate_executor_fn_;
+};
+
 class any_completion_handler_allocate_fn
 class any_completion_handler_allocate_fn
 {
 {
 public:
 public:
@@ -368,6 +407,7 @@ template <typename... Signatures>
 class any_completion_handler_fn_table
 class any_completion_handler_fn_table
   : private any_completion_handler_destroy_fn,
   : private any_completion_handler_destroy_fn,
     private any_completion_handler_executor_fn,
     private any_completion_handler_executor_fn,
+    private any_completion_handler_immediate_executor_fn,
     private any_completion_handler_allocate_fn,
     private any_completion_handler_allocate_fn,
     private any_completion_handler_deallocate_fn,
     private any_completion_handler_deallocate_fn,
     private any_completion_handler_call_fns<Signatures...>
     private any_completion_handler_call_fns<Signatures...>
@@ -377,11 +417,13 @@ public:
   constexpr any_completion_handler_fn_table(
   constexpr any_completion_handler_fn_table(
       any_completion_handler_destroy_fn::type destroy_fn,
       any_completion_handler_destroy_fn::type destroy_fn,
       any_completion_handler_executor_fn::type executor_fn,
       any_completion_handler_executor_fn::type executor_fn,
+      any_completion_handler_immediate_executor_fn::type immediate_executor_fn,
       any_completion_handler_allocate_fn::type allocate_fn,
       any_completion_handler_allocate_fn::type allocate_fn,
       any_completion_handler_deallocate_fn::type deallocate_fn,
       any_completion_handler_deallocate_fn::type deallocate_fn,
       CallFns... call_fns)
       CallFns... call_fns)
     : any_completion_handler_destroy_fn(destroy_fn),
     : any_completion_handler_destroy_fn(destroy_fn),
       any_completion_handler_executor_fn(executor_fn),
       any_completion_handler_executor_fn(executor_fn),
+      any_completion_handler_immediate_executor_fn(immediate_executor_fn),
       any_completion_handler_allocate_fn(allocate_fn),
       any_completion_handler_allocate_fn(allocate_fn),
       any_completion_handler_deallocate_fn(deallocate_fn),
       any_completion_handler_deallocate_fn(deallocate_fn),
       any_completion_handler_call_fns<Signatures...>(call_fns...)
       any_completion_handler_call_fns<Signatures...>(call_fns...)
@@ -390,6 +432,7 @@ public:
 
 
   using any_completion_handler_destroy_fn::destroy;
   using any_completion_handler_destroy_fn::destroy;
   using any_completion_handler_executor_fn::executor;
   using any_completion_handler_executor_fn::executor;
+  using any_completion_handler_immediate_executor_fn::immediate_executor;
   using any_completion_handler_allocate_fn::allocate;
   using any_completion_handler_allocate_fn::allocate;
   using any_completion_handler_deallocate_fn::deallocate;
   using any_completion_handler_deallocate_fn::deallocate;
   using any_completion_handler_call_fns<Signatures...>::call;
   using any_completion_handler_call_fns<Signatures...>::call;
@@ -402,6 +445,7 @@ struct any_completion_handler_fn_table_instance
     value = any_completion_handler_fn_table<Signatures...>(
     value = any_completion_handler_fn_table<Signatures...>(
         &any_completion_handler_destroy_fn::impl<Handler>,
         &any_completion_handler_destroy_fn::impl<Handler>,
         &any_completion_handler_executor_fn::impl<Handler>,
         &any_completion_handler_executor_fn::impl<Handler>,
+        &any_completion_handler_immediate_executor_fn::impl<Handler>,
         &any_completion_handler_allocate_fn::impl<Handler>,
         &any_completion_handler_allocate_fn::impl<Handler>,
         &any_completion_handler_deallocate_fn::impl<Handler>,
         &any_completion_handler_deallocate_fn::impl<Handler>,
         &any_completion_handler_call_fn<Signatures>::template impl<Handler>...);
         &any_completion_handler_call_fn<Signatures>::template impl<Handler>...);
@@ -577,6 +621,9 @@ private:
   template <typename, typename>
   template <typename, typename>
   friend struct associated_executor;
   friend struct associated_executor;
 
 
+  template <typename, typename>
+  friend struct associated_immediate_executor;
+
   const detail::any_completion_handler_fn_table<Signatures...>* fn_table_;
   const detail::any_completion_handler_fn_table<Signatures...>* fn_table_;
   detail::any_completion_handler_impl_base* impl_;
   detail::any_completion_handler_impl_base* impl_;
 #endif // !defined(GENERATING_DOCUMENTATION)
 #endif // !defined(GENERATING_DOCUMENTATION)
@@ -751,6 +798,20 @@ struct associated_executor<any_completion_handler<Signatures...>, Candidate>
   }
   }
 };
 };
 
 
+template <typename... Signatures, typename Candidate>
+struct associated_immediate_executor<
+    any_completion_handler<Signatures...>, Candidate>
+{
+  using type = any_completion_executor;
+
+  static type get(const any_completion_handler<Signatures...>& handler,
+      const Candidate& candidate = Candidate()) BOOST_ASIO_NOEXCEPT
+  {
+    return handler.fn_table_->immediate_executor(handler.impl_,
+        any_io_executor(std::nothrow, candidate));
+  }
+};
+
 } // namespace asio
 } // namespace asio
 } // namespace boost
 } // namespace boost
 
 

+ 25 - 9
contrib/restricted/boost/asio/include/boost/asio/bind_allocator.hpp

@@ -472,20 +472,40 @@ namespace detail {
 
 
 template <typename TargetAsyncResult,
 template <typename TargetAsyncResult,
   typename Allocator, typename = void>
   typename Allocator, typename = void>
-struct allocator_binder_async_result_completion_handler_type
+class allocator_binder_completion_handler_async_result
 {
 {
+public:
+  template <typename T>
+  explicit allocator_binder_completion_handler_async_result(T&)
+  {
+  }
 };
 };
 
 
 template <typename TargetAsyncResult, typename Allocator>
 template <typename TargetAsyncResult, typename Allocator>
-struct allocator_binder_async_result_completion_handler_type<
+class allocator_binder_completion_handler_async_result<
   TargetAsyncResult, Allocator,
   TargetAsyncResult, Allocator,
   typename void_type<
   typename void_type<
     typename TargetAsyncResult::completion_handler_type
     typename TargetAsyncResult::completion_handler_type
   >::type>
   >::type>
 {
 {
+public:
   typedef allocator_binder<
   typedef allocator_binder<
     typename TargetAsyncResult::completion_handler_type, Allocator>
     typename TargetAsyncResult::completion_handler_type, Allocator>
       completion_handler_type;
       completion_handler_type;
+
+  explicit allocator_binder_completion_handler_async_result(
+      typename TargetAsyncResult::completion_handler_type& handler)
+    : target_(handler)
+  {
+  }
+
+  typename TargetAsyncResult::return_type get()
+  {
+    return target_.get();
+  }
+
+private:
+  TargetAsyncResult target_;
 };
 };
 
 
 template <typename TargetAsyncResult, typename = void>
 template <typename TargetAsyncResult, typename = void>
@@ -507,22 +527,18 @@ struct allocator_binder_async_result_return_type<
 
 
 template <typename T, typename Allocator, typename Signature>
 template <typename T, typename Allocator, typename Signature>
 class async_result<allocator_binder<T, Allocator>, Signature> :
 class async_result<allocator_binder<T, Allocator>, Signature> :
-  public detail::allocator_binder_async_result_completion_handler_type<
+  public detail::allocator_binder_completion_handler_async_result<
     async_result<T, Signature>, Allocator>,
     async_result<T, Signature>, Allocator>,
   public detail::allocator_binder_async_result_return_type<
   public detail::allocator_binder_async_result_return_type<
     async_result<T, Signature> >
     async_result<T, Signature> >
 {
 {
 public:
 public:
   explicit async_result(allocator_binder<T, Allocator>& b)
   explicit async_result(allocator_binder<T, Allocator>& b)
-    : target_(b.get())
+    : detail::allocator_binder_completion_handler_async_result<
+        async_result<T, Signature>, Allocator>(b.get())
   {
   {
   }
   }
 
 
-  typename async_result<T, Signature>::return_type get()
-  {
-    return target_.get();
-  }
-
   template <typename Initiation>
   template <typename Initiation>
   struct init_wrapper
   struct init_wrapper
   {
   {

+ 25 - 9
contrib/restricted/boost/asio/include/boost/asio/bind_cancellation_slot.hpp

@@ -474,20 +474,40 @@ namespace detail {
 
 
 template <typename TargetAsyncResult,
 template <typename TargetAsyncResult,
   typename CancellationSlot, typename = void>
   typename CancellationSlot, typename = void>
-struct cancellation_slot_binder_async_result_completion_handler_type
+class cancellation_slot_binder_completion_handler_async_result
 {
 {
+public:
+  template <typename T>
+  explicit cancellation_slot_binder_completion_handler_async_result(T&)
+  {
+  }
 };
 };
 
 
 template <typename TargetAsyncResult, typename CancellationSlot>
 template <typename TargetAsyncResult, typename CancellationSlot>
-struct cancellation_slot_binder_async_result_completion_handler_type<
+class cancellation_slot_binder_completion_handler_async_result<
   TargetAsyncResult, CancellationSlot,
   TargetAsyncResult, CancellationSlot,
   typename void_type<
   typename void_type<
     typename TargetAsyncResult::completion_handler_type
     typename TargetAsyncResult::completion_handler_type
   >::type>
   >::type>
 {
 {
+public:
   typedef cancellation_slot_binder<
   typedef cancellation_slot_binder<
     typename TargetAsyncResult::completion_handler_type, CancellationSlot>
     typename TargetAsyncResult::completion_handler_type, CancellationSlot>
       completion_handler_type;
       completion_handler_type;
+
+  explicit cancellation_slot_binder_completion_handler_async_result(
+      typename TargetAsyncResult::completion_handler_type& handler)
+    : target_(handler)
+  {
+  }
+
+  typename TargetAsyncResult::return_type get()
+  {
+    return target_.get();
+  }
+
+private:
+  TargetAsyncResult target_;
 };
 };
 
 
 template <typename TargetAsyncResult, typename = void>
 template <typename TargetAsyncResult, typename = void>
@@ -509,22 +529,18 @@ struct cancellation_slot_binder_async_result_return_type<
 
 
 template <typename T, typename CancellationSlot, typename Signature>
 template <typename T, typename CancellationSlot, typename Signature>
 class async_result<cancellation_slot_binder<T, CancellationSlot>, Signature> :
 class async_result<cancellation_slot_binder<T, CancellationSlot>, Signature> :
-  public detail::cancellation_slot_binder_async_result_completion_handler_type<
+  public detail::cancellation_slot_binder_completion_handler_async_result<
     async_result<T, Signature>, CancellationSlot>,
     async_result<T, Signature>, CancellationSlot>,
   public detail::cancellation_slot_binder_async_result_return_type<
   public detail::cancellation_slot_binder_async_result_return_type<
     async_result<T, Signature> >
     async_result<T, Signature> >
 {
 {
 public:
 public:
   explicit async_result(cancellation_slot_binder<T, CancellationSlot>& b)
   explicit async_result(cancellation_slot_binder<T, CancellationSlot>& b)
-    : target_(b.get())
+    : detail::cancellation_slot_binder_completion_handler_async_result<
+        async_result<T, Signature>, CancellationSlot>(b.get())
   {
   {
   }
   }
 
 
-  typename async_result<T, Signature>::return_type get()
-  {
-    return target_.get();
-  }
-
   template <typename Initiation>
   template <typename Initiation>
   struct init_wrapper
   struct init_wrapper
   {
   {

+ 26 - 11
contrib/restricted/boost/asio/include/boost/asio/bind_immediate_executor.hpp

@@ -472,22 +472,41 @@ bind_immediate_executor(const Executor& e, BOOST_ASIO_MOVE_ARG(T) t)
 
 
 namespace detail {
 namespace detail {
 
 
-template <typename TargetAsyncResult,
-  typename Executor, typename = void>
-struct immediate_executor_binder_async_result_completion_handler_type
+template <typename TargetAsyncResult, typename Executor, typename = void>
+class immediate_executor_binder_completion_handler_async_result
 {
 {
+public:
+  template <typename T>
+  explicit immediate_executor_binder_completion_handler_async_result(T&)
+  {
+  }
 };
 };
 
 
 template <typename TargetAsyncResult, typename Executor>
 template <typename TargetAsyncResult, typename Executor>
-struct immediate_executor_binder_async_result_completion_handler_type<
+class immediate_executor_binder_completion_handler_async_result<
   TargetAsyncResult, Executor,
   TargetAsyncResult, Executor,
   typename void_type<
   typename void_type<
     typename TargetAsyncResult::completion_handler_type
     typename TargetAsyncResult::completion_handler_type
   >::type>
   >::type>
 {
 {
+public:
   typedef immediate_executor_binder<
   typedef immediate_executor_binder<
     typename TargetAsyncResult::completion_handler_type, Executor>
     typename TargetAsyncResult::completion_handler_type, Executor>
       completion_handler_type;
       completion_handler_type;
+
+  explicit immediate_executor_binder_completion_handler_async_result(
+      typename TargetAsyncResult::completion_handler_type& handler)
+    : target_(handler)
+  {
+  }
+
+  typename TargetAsyncResult::return_type get()
+  {
+    return target_.get();
+  }
+
+private:
+  TargetAsyncResult target_;
 };
 };
 
 
 template <typename TargetAsyncResult, typename = void>
 template <typename TargetAsyncResult, typename = void>
@@ -509,22 +528,18 @@ struct immediate_executor_binder_async_result_return_type<
 
 
 template <typename T, typename Executor, typename Signature>
 template <typename T, typename Executor, typename Signature>
 class async_result<immediate_executor_binder<T, Executor>, Signature> :
 class async_result<immediate_executor_binder<T, Executor>, Signature> :
-  public detail::immediate_executor_binder_async_result_completion_handler_type<
+  public detail::immediate_executor_binder_completion_handler_async_result<
     async_result<T, Signature>, Executor>,
     async_result<T, Signature>, Executor>,
   public detail::immediate_executor_binder_async_result_return_type<
   public detail::immediate_executor_binder_async_result_return_type<
     async_result<T, Signature> >
     async_result<T, Signature> >
 {
 {
 public:
 public:
   explicit async_result(immediate_executor_binder<T, Executor>& b)
   explicit async_result(immediate_executor_binder<T, Executor>& b)
-    : target_(b.get())
+    : detail::immediate_executor_binder_completion_handler_async_result<
+        async_result<T, Signature>, Executor>(b.get())
   {
   {
   }
   }
 
 
-  typename async_result<T, Signature>::return_type get()
-  {
-    return target_.get();
-  }
-
   template <typename Initiation>
   template <typename Initiation>
   struct init_wrapper
   struct init_wrapper
   {
   {

+ 7 - 0
contrib/restricted/boost/asio/include/boost/asio/compose.hpp

@@ -340,6 +340,13 @@ struct associator<Associator,
  * @param io_objects_or_executors Zero or more I/O objects or I/O executors for
  * @param io_objects_or_executors Zero or more I/O objects or I/O executors for
  * which outstanding work must be maintained.
  * which outstanding work must be maintained.
  *
  *
+ * @par Per-Operation Cancellation
+ * By default, terminal per-operation cancellation is enabled for
+ * composed operations that are implemented using @c async_compose. To
+ * disable cancellation for the composed operation, or to alter its
+ * supported cancellation types, call the @c self object's @c
+ * reset_cancellation_state function.
+ *
  * @par Example:
  * @par Example:
  *
  *
  * @code struct async_echo_implementation
  * @code struct async_echo_implementation

+ 23 - 2
contrib/restricted/boost/asio/include/boost/asio/detail/config.hpp

@@ -1679,7 +1679,7 @@
 # include <unistd.h>
 # include <unistd.h>
 #endif // defined(BOOST_ASIO_HAS_UNISTD_H)
 #endif // defined(BOOST_ASIO_HAS_UNISTD_H)
 
 
-// Linux: epoll, eventfd and timerfd.
+// Linux: epoll, eventfd, timerfd and io_uring.
 #if defined(__linux__)
 #if defined(__linux__)
 # include <linux/version.h>
 # include <linux/version.h>
 # if !defined(BOOST_ASIO_HAS_EPOLL)
 # if !defined(BOOST_ASIO_HAS_EPOLL)
@@ -1703,6 +1703,11 @@
 #   endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
 #   endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
 #  endif // defined(BOOST_ASIO_HAS_EPOLL)
 #  endif // defined(BOOST_ASIO_HAS_EPOLL)
 # endif // !defined(BOOST_ASIO_HAS_TIMERFD)
 # endif // !defined(BOOST_ASIO_HAS_TIMERFD)
+# if defined(BOOST_ASIO_HAS_IO_URING)
+#  if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0)
+#   error Linux kernel 5.10 or later is required to support io_uring
+#  endif // LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0)
+# endif // defined(BOOST_ASIO_HAS_IO_URING)
 #endif // defined(__linux__)
 #endif // defined(__linux__)
 
 
 // Linux: io_uring is used instead of epoll.
 // Linux: io_uring is used instead of epoll.
@@ -2042,7 +2047,7 @@
 # endif // !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
 # endif // !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
 #endif // !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
 #endif // !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
 
 
-// Support for the __thread keyword extension.
+// Support for the __thread keyword extension, or equivalent.
 #if !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
 #if !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
 # if defined(__linux__)
 # if defined(__linux__)
 #  if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
 #  if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
@@ -2064,6 +2069,22 @@
 #   define BOOST_ASIO_THREAD_KEYWORD __declspec(thread)
 #   define BOOST_ASIO_THREAD_KEYWORD __declspec(thread)
 #  endif // (_MSC_VER >= 1700)
 #  endif // (_MSC_VER >= 1700)
 # endif // defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
 # endif // defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
+# if defined(__APPLE__)
+#  if defined(__clang__)
+#   if defined(__apple_build_version__)
+#    define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
+#    define BOOST_ASIO_THREAD_KEYWORD __thread
+#   endif // defined(__apple_build_version__)
+#  endif // defined(__clang__)
+# endif // defined(__APPLE__)
+# if !defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
+#  if defined(BOOST_ASIO_HAS_BOOST_CONFIG)
+#   if !defined(BOOST_NO_CXX11_THREAD_LOCAL)
+#    define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
+#    define BOOST_ASIO_THREAD_KEYWORD thread_local
+#   endif // !defined(BOOST_NO_CXX11_THREAD_LOCAL)
+#  endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG)
+# endif // !defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
 #endif // !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
 #endif // !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
 #if !defined(BOOST_ASIO_THREAD_KEYWORD)
 #if !defined(BOOST_ASIO_THREAD_KEYWORD)
 # define BOOST_ASIO_THREAD_KEYWORD __thread
 # define BOOST_ASIO_THREAD_KEYWORD __thread

+ 1 - 2
contrib/restricted/boost/asio/include/boost/asio/detail/dev_poll_reactor.hpp

@@ -109,10 +109,9 @@ public:
   {
   {
     start_op(op_type, descriptor, descriptor_data,
     start_op(op_type, descriptor, descriptor_data,
         op, is_continuation, allow_speculative,
         op, is_continuation, allow_speculative,
-        &epoll_reactor::call_post_immediate_completion, this);
+        &dev_poll_reactor::call_post_immediate_completion, this);
   }
   }
 
 
-
   // Cancel all operations associated with the given descriptor. The
   // Cancel all operations associated with the given descriptor. The
   // handlers associated with the descriptor will be invoked with the
   // handlers associated with the descriptor will be invoked with the
   // operation_aborted error.
   // operation_aborted error.

+ 33 - 28
contrib/restricted/boost/asio/include/boost/asio/detail/impl/io_uring_service.ipp

@@ -436,15 +436,16 @@ void io_uring_service::run(long usec, op_queue<operation>& ops)
     ? ::io_uring_peek_cqe(&ring_, &cqe)
     ? ::io_uring_peek_cqe(&ring_, &cqe)
     : ::io_uring_wait_cqe(&ring_, &cqe);
     : ::io_uring_wait_cqe(&ring_, &cqe);
 
 
-  if (result == 0 && usec > 0)
+  if (local_ops > 0)
   {
   {
-    if (::io_uring_cqe_get_data(cqe) != &ts)
+    if (result != 0 || ::io_uring_cqe_get_data(cqe) != &ts)
     {
     {
       mutex::scoped_lock lock(mutex_);
       mutex::scoped_lock lock(mutex_);
       if (::io_uring_sqe* sqe = get_sqe())
       if (::io_uring_sqe* sqe = get_sqe())
       {
       {
         ++local_ops;
         ++local_ops;
         ::io_uring_prep_timeout_remove(sqe, reinterpret_cast<__u64>(&ts), 0);
         ::io_uring_prep_timeout_remove(sqe, reinterpret_cast<__u64>(&ts), 0);
+        ::io_uring_sqe_set_data(sqe, &ts);
         submit_sqes();
         submit_sqes();
       }
       }
     }
     }
@@ -452,37 +453,41 @@ void io_uring_service::run(long usec, op_queue<operation>& ops)
 
 
   bool check_timers = false;
   bool check_timers = false;
   int count = 0;
   int count = 0;
-  while (result == 0)
+  while (result == 0 || local_ops > 0)
   {
   {
-    if (void* ptr = ::io_uring_cqe_get_data(cqe))
+    if (result == 0)
     {
     {
-      if (ptr == this)
+      if (void* ptr = ::io_uring_cqe_get_data(cqe))
       {
       {
-        // The io_uring service was interrupted.
-      }
-      else if (ptr == &timer_queues_)
-      {
-        check_timers = true;
-      }
-      else if (ptr == &timeout_)
-      {
-        check_timers = true;
-        timeout_.tv_sec = 0;
-        timeout_.tv_nsec = 0;
-      }
-      else if (ptr == &ts)
-      {
-        --local_ops;
-      }
-      else
-      {
-        io_queue* io_q = static_cast<io_queue*>(ptr);
-        io_q->set_result(cqe->res);
-        ops.push(io_q);
+        if (ptr == this)
+        {
+          // The io_uring service was interrupted.
+        }
+        else if (ptr == &timer_queues_)
+        {
+          check_timers = true;
+        }
+        else if (ptr == &timeout_)
+        {
+          check_timers = true;
+          timeout_.tv_sec = 0;
+          timeout_.tv_nsec = 0;
+        }
+        else if (ptr == &ts)
+        {
+          --local_ops;
+        }
+        else
+        {
+          io_queue* io_q = static_cast<io_queue*>(ptr);
+          io_q->set_result(cqe->res);
+          ops.push(io_q);
+        }
       }
       }
+      ::io_uring_cqe_seen(&ring_, cqe);
+      ++count;
     }
     }
-    ::io_uring_cqe_seen(&ring_, cqe);
-    result = (++count < complete_batch_size || local_ops > 0)
+    result = (count < complete_batch_size || local_ops > 0)
       ? ::io_uring_peek_cqe(&ring_, &cqe) : -EAGAIN;
       ? ::io_uring_peek_cqe(&ring_, &cqe) : -EAGAIN;
   }
   }
 
 

+ 2 - 0
contrib/restricted/boost/asio/include/boost/asio/detail/impl/signal_set_service.ipp

@@ -387,6 +387,7 @@ boost::system::error_code signal_set_service::add(
         if (state->flags_[signal_number] != signal_set_base::flags::dont_care)
         if (state->flags_[signal_number] != signal_set_base::flags::dont_care)
         {
         {
           ec = boost::asio::error::invalid_argument;
           ec = boost::asio::error::invalid_argument;
+          delete new_registration;
           return ec;
           return ec;
         }
         }
         struct sigaction sa;
         struct sigaction sa;
@@ -398,6 +399,7 @@ boost::system::error_code signal_set_service::add(
         {
         {
           ec = boost::system::error_code(errno,
           ec = boost::system::error_code(errno,
               boost::asio::error::get_system_category());
               boost::asio::error::get_system_category());
+          delete new_registration;
           return ec;
           return ec;
         }
         }
         state->flags_[signal_number] = f;
         state->flags_[signal_number] = f;

+ 2 - 0
contrib/restricted/boost/asio/include/boost/asio/detail/memory.hpp

@@ -46,10 +46,12 @@ namespace asio {
 namespace detail {
 namespace detail {
 
 
 #if defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
 #if defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
+using std::allocate_shared;
 using std::make_shared;
 using std::make_shared;
 using std::shared_ptr;
 using std::shared_ptr;
 using std::weak_ptr;
 using std::weak_ptr;
 #else // defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
 #else // defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
+using boost::allocate_shared;
 using boost::make_shared;
 using boost::make_shared;
 using boost::shared_ptr;
 using boost::shared_ptr;
 using boost::weak_ptr;
 using boost::weak_ptr;

Некоторые файлы не были показаны из-за большого количества измененных файлов