passenger 6.0.16 → 6.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (286) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +22 -1
  3. data/build/integration_tests.rb +6 -6
  4. data/build/ruby_tests.rb +1 -1
  5. data/build/test_basics.rb +0 -1
  6. data/src/agent/Core/Config.h +1 -1
  7. data/src/agent/Core/Controller/Config.h +1 -1
  8. data/src/agent/Core/SpawningKit/PipeWatcher.h +18 -3
  9. data/src/agent/Watchdog/Config.h +1 -1
  10. data/src/cxx_supportlib/Constants.h +1 -1
  11. data/src/cxx_supportlib/vendor-modified/boost/align/aligned_alloc.hpp +1 -1
  12. data/src/cxx_supportlib/vendor-modified/boost/array.hpp +1 -1
  13. data/src/cxx_supportlib/vendor-modified/boost/asio/any_completion_executor.hpp +344 -0
  14. data/src/cxx_supportlib/vendor-modified/boost/asio/any_completion_handler.hpp +686 -0
  15. data/src/cxx_supportlib/vendor-modified/boost/asio/any_io_executor.hpp +56 -0
  16. data/src/cxx_supportlib/vendor-modified/boost/asio/associated_allocator.hpp +81 -25
  17. data/src/cxx_supportlib/vendor-modified/boost/asio/associated_cancellation_slot.hpp +68 -8
  18. data/src/cxx_supportlib/vendor-modified/boost/asio/associated_executor.hpp +46 -11
  19. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_datagram_socket.hpp +4 -4
  20. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_deadline_timer.hpp +2 -2
  21. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_file.hpp +1 -1
  22. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_random_access_file.hpp +2 -2
  23. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_raw_socket.hpp +4 -4
  24. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_readable_pipe.hpp +2 -2
  25. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_seq_packet_socket.hpp +2 -2
  26. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_serial_port.hpp +3 -3
  27. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_signal_set.hpp +2 -2
  28. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket.hpp +3 -3
  29. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_acceptor.hpp +4 -4
  30. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_file.hpp +2 -2
  31. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_socket.hpp +2 -2
  32. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_waitable_timer.hpp +2 -2
  33. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_writable_pipe.hpp +2 -2
  34. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_allocator.hpp +13 -3
  35. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_cancellation_slot.hpp +14 -3
  36. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_executor.hpp +13 -3
  37. data/src/cxx_supportlib/vendor-modified/boost/asio/compose.hpp +30 -305
  38. data/src/cxx_supportlib/vendor-modified/boost/asio/consign.hpp +90 -0
  39. data/src/cxx_supportlib/vendor-modified/boost/asio/defer.hpp +17 -18
  40. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/bind_handler.hpp +98 -24
  41. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/composed_work.hpp +330 -0
  42. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/config.hpp +81 -15
  43. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_alloc_helpers.hpp +4 -4
  44. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_work.hpp +19 -11
  45. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/descriptor_ops.ipp +37 -0
  46. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/handler_tracking.ipp +3 -1
  47. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/select_reactor.ipp +1 -1
  48. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_ops.ipp +10 -2
  49. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/strand_executor_service.hpp +14 -1
  50. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/memory.hpp +18 -0
  51. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/utility.hpp +1 -2
  52. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/work_dispatcher.hpp +7 -3
  53. data/src/cxx_supportlib/vendor-modified/boost/asio/dispatch.hpp +4 -14
  54. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/allocator.hpp +22 -3
  55. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/any_executor.hpp +447 -142
  56. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking.hpp +57 -8
  57. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking_adaptation.hpp +51 -6
  58. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/bulk_execute.hpp +5 -0
  59. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/bulk_guarantee.hpp +41 -4
  60. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/connect.hpp +5 -0
  61. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/context.hpp +13 -2
  62. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/context_as.hpp +13 -2
  63. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/detail/as_operation.hpp +4 -0
  64. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/execute.hpp +9 -2
  65. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/executor.hpp +11 -1
  66. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/mapping.hpp +52 -8
  67. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/occupancy.hpp +13 -2
  68. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/operation_state.hpp +5 -0
  69. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/outstanding_work.hpp +39 -6
  70. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/receiver.hpp +5 -0
  71. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/relationship.hpp +39 -6
  72. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/schedule.hpp +5 -0
  73. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/scheduler.hpp +5 -0
  74. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/sender.hpp +5 -0
  75. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/set_done.hpp +5 -0
  76. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/set_error.hpp +5 -0
  77. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/set_value.hpp +5 -0
  78. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/start.hpp +5 -0
  79. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/submit.hpp +5 -0
  80. data/src/cxx_supportlib/vendor-modified/boost/asio/executor_work_guard.hpp +6 -9
  81. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_channel.hpp +3 -3
  82. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_concurrent_channel.hpp +3 -3
  83. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/channel_traits.hpp +70 -0
  84. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/co_composed.hpp +146 -0
  85. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/coro.hpp +35 -5
  86. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_handler.hpp +13 -3
  87. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_operation.hpp +7 -0
  88. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_service.hpp +180 -0
  89. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/coro_completion_handler.hpp +171 -0
  90. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/coro_promise_allocator.hpp +89 -66
  91. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/partial_promise.hpp +66 -45
  92. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/as_single.hpp +13 -3
  93. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/co_composed.hpp +1134 -0
  94. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/coro.hpp +130 -106
  95. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/parallel_group.hpp +377 -3
  96. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/promise.hpp +168 -29
  97. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/use_coro.hpp +149 -203
  98. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/use_promise.hpp +68 -0
  99. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/parallel_group.hpp +256 -0
  100. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/promise.hpp +76 -80
  101. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_coro.hpp +40 -14
  102. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_promise.hpp +113 -0
  103. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/any_completion_executor.ipp +132 -0
  104. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/any_io_executor.ipp +12 -0
  105. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/append.hpp +12 -3
  106. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/as_tuple.hpp +12 -3
  107. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_read_stream.hpp +25 -6
  108. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_write_stream.hpp +25 -6
  109. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/co_spawn.hpp +34 -45
  110. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/connect.hpp +28 -6
  111. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/consign.hpp +204 -0
  112. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/defer.hpp +33 -1
  113. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/deferred.hpp +13 -3
  114. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/dispatch.hpp +21 -9
  115. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/handler_alloc_hook.ipp +1 -1
  116. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/post.hpp +33 -1
  117. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/prepend.hpp +12 -3
  118. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read.hpp +40 -9
  119. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_at.hpp +27 -6
  120. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_until.hpp +104 -24
  121. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/redirect_error.hpp +12 -3
  122. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/spawn.hpp +70 -15
  123. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/src.hpp +1 -0
  124. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/use_future.hpp +25 -0
  125. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write.hpp +38 -30
  126. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write_at.hpp +27 -6
  127. data/src/cxx_supportlib/vendor-modified/boost/asio/io_context.hpp +0 -13
  128. data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/network_v4.ipp +3 -1
  129. data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/network_v6.ipp +3 -1
  130. data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_descriptor.hpp +2 -2
  131. data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_stream_descriptor.hpp +2 -2
  132. data/src/cxx_supportlib/vendor-modified/boost/asio/post.hpp +17 -18
  133. data/src/cxx_supportlib/vendor-modified/boost/asio/spawn.hpp +3 -1
  134. data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/io.hpp +13 -3
  135. data/src/cxx_supportlib/vendor-modified/boost/asio/strand.hpp +11 -7
  136. data/src/cxx_supportlib/vendor-modified/boost/asio/system_executor.hpp +0 -13
  137. data/src/cxx_supportlib/vendor-modified/boost/asio/thread_pool.hpp +23 -18
  138. data/src/cxx_supportlib/vendor-modified/boost/asio/version.hpp +1 -1
  139. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_object_handle.hpp +2 -2
  140. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_overlapped_handle.hpp +1 -1
  141. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_random_access_handle.hpp +2 -2
  142. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_stream_handle.hpp +2 -2
  143. data/src/cxx_supportlib/vendor-modified/boost/asio.hpp +4 -0
  144. data/src/cxx_supportlib/vendor-modified/boost/bind/bind.hpp +1 -1
  145. data/src/cxx_supportlib/vendor-modified/boost/chrono/config.hpp +1 -0
  146. data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/mac/chrono.hpp +4 -4
  147. data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/scan_keyword.hpp +4 -2
  148. data/src/cxx_supportlib/vendor-modified/boost/chrono/duration.hpp +2 -2
  149. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_io.hpp +3 -3
  150. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_put.hpp +5 -5
  151. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_units.hpp +2 -2
  152. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_io.hpp +2 -2
  153. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/utility/ios_base_state_ptr.hpp +7 -7
  154. data/src/cxx_supportlib/vendor-modified/boost/chrono/time_point.hpp +1 -1
  155. data/src/cxx_supportlib/vendor-modified/boost/circular_buffer/details.hpp +5 -1
  156. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang.hpp +10 -3
  157. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang_version.hpp +9 -3
  158. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/gcc.hpp +9 -3
  159. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/sunpro_cc.hpp +6 -0
  160. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/visualc.hpp +8 -0
  161. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/xlcpp.hpp +4 -0
  162. data/src/cxx_supportlib/vendor-modified/boost/config/detail/suffix.hpp +33 -0
  163. data/src/cxx_supportlib/vendor-modified/boost/config/header_deprecated.hpp +1 -1
  164. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libcpp.hpp +9 -0
  165. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libstdcpp3.hpp +4 -2
  166. data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +1 -1
  167. data/src/cxx_supportlib/vendor-modified/boost/container/container_fwd.hpp +29 -0
  168. data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +13 -13
  169. data/src/cxx_supportlib/vendor-modified/boost/container/detail/advanced_insert_int.hpp +80 -95
  170. data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_begin.hpp +10 -0
  171. data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_end.hpp +3 -0
  172. data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +738 -34
  173. data/src/cxx_supportlib/vendor-modified/boost/container/detail/destroyers.hpp +38 -10
  174. data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +1 -0
  175. data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterator.hpp +2 -0
  176. data/src/cxx_supportlib/vendor-modified/boost/container/detail/workaround.hpp +3 -4
  177. data/src/cxx_supportlib/vendor-modified/boost/container/devector.hpp +1150 -1213
  178. data/src/cxx_supportlib/vendor-modified/boost/container/node_allocator.hpp +1 -1
  179. data/src/cxx_supportlib/vendor-modified/boost/container/options.hpp +104 -12
  180. data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +1 -0
  181. data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +11 -1
  182. data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +31 -331
  183. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_mix.hpp +113 -0
  184. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_range.hpp +173 -0
  185. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_tuple.hpp +133 -0
  186. data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash.hpp +461 -566
  187. data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash_fwd.hpp +24 -24
  188. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_contiguous_range.hpp +91 -0
  189. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_described_class.hpp +38 -0
  190. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_range.hpp +73 -0
  191. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_unordered_range.hpp +39 -0
  192. data/src/cxx_supportlib/vendor-modified/boost/core/bit.hpp +32 -4
  193. data/src/cxx_supportlib/vendor-modified/boost/core/detail/string_view.hpp +16 -0
  194. data/src/cxx_supportlib/vendor-modified/boost/core/empty_value.hpp +16 -16
  195. data/src/cxx_supportlib/vendor-modified/boost/core/fclose_deleter.hpp +46 -0
  196. data/src/cxx_supportlib/vendor-modified/boost/date_time/date.hpp +1 -1
  197. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/formatters.hpp +3 -3
  198. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/formatters_limited.hpp +3 -3
  199. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_date.hpp +12 -13
  200. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/parsers.hpp +2 -2
  201. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian_calendar.ipp +2 -2
  202. data/src/cxx_supportlib/vendor-modified/boost/date_time/iso_format.hpp +13 -13
  203. data/src/cxx_supportlib/vendor-modified/boost/date_time/local_time/local_date_time.hpp +2 -2
  204. data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/time_formatters.hpp +4 -4
  205. data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/time_formatters_limited.hpp +2 -2
  206. data/src/cxx_supportlib/vendor-modified/boost/date_time/special_values_parser.hpp +1 -1
  207. data/src/cxx_supportlib/vendor-modified/boost/date_time/time_facet.hpp +1 -1
  208. data/src/cxx_supportlib/vendor-modified/boost/date_time/time_parsing.hpp +2 -2
  209. data/src/cxx_supportlib/vendor-modified/boost/describe/bases.hpp +50 -0
  210. data/src/cxx_supportlib/vendor-modified/boost/describe/detail/config.hpp +40 -0
  211. data/src/cxx_supportlib/vendor-modified/boost/describe/detail/cx_streq.hpp +30 -0
  212. data/src/cxx_supportlib/vendor-modified/boost/describe/detail/void_t.hpp +32 -0
  213. data/src/cxx_supportlib/vendor-modified/boost/describe/members.hpp +159 -0
  214. data/src/cxx_supportlib/vendor-modified/boost/describe/modifiers.hpp +33 -0
  215. data/src/cxx_supportlib/vendor-modified/boost/intrusive/avltree_algorithms.hpp +9 -9
  216. data/src/cxx_supportlib/vendor-modified/boost/intrusive/bstree_algorithms.hpp +45 -45
  217. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/any_node_and_algorithms.hpp +8 -8
  218. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/bstree_algorithms_base.hpp +37 -38
  219. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/iterator.hpp +16 -0
  220. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/workaround.hpp +1 -1
  221. data/src/cxx_supportlib/vendor-modified/boost/intrusive/hashtable.hpp +145 -90
  222. data/src/cxx_supportlib/vendor-modified/boost/intrusive/pack_options.hpp +2 -0
  223. data/src/cxx_supportlib/vendor-modified/boost/intrusive/rbtree_algorithms.hpp +7 -7
  224. data/src/cxx_supportlib/vendor-modified/boost/intrusive/sgtree_algorithms.hpp +5 -5
  225. data/src/cxx_supportlib/vendor-modified/boost/intrusive/splaytree_algorithms.hpp +11 -9
  226. data/src/cxx_supportlib/vendor-modified/boost/intrusive/treap_algorithms.hpp +7 -7
  227. data/src/cxx_supportlib/vendor-modified/boost/iterator/iterator_facade.hpp +106 -25
  228. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +1 -1
  229. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_numeric.hpp +8 -5
  230. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_unsigned_converters.hpp +1 -1
  231. data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/adaptive_sort_merge.hpp +4 -2
  232. data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/pdqsort.hpp +2 -1
  233. data/src/cxx_supportlib/vendor-modified/boost/move/detail/type_traits.hpp +8 -4
  234. data/src/cxx_supportlib/vendor-modified/boost/mp11/bind.hpp +111 -0
  235. data/src/cxx_supportlib/vendor-modified/boost/mp11/version.hpp +1 -1
  236. data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/int_float_mixture.hpp +5 -5
  237. data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/sign_mixture.hpp +5 -5
  238. data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/udt_builtin_mixture.hpp +5 -5
  239. data/src/cxx_supportlib/vendor-modified/boost/preprocessor/variadic/has_opt.hpp +6 -2
  240. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp +11 -2
  241. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/intrusive_ptr.hpp +1 -1
  242. data/src/cxx_supportlib/vendor-modified/boost/system/detail/config.hpp +7 -1
  243. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category.hpp +2 -2
  244. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category_impl.hpp +10 -1
  245. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_code.hpp +38 -43
  246. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_condition.hpp +52 -0
  247. data/src/cxx_supportlib/vendor-modified/boost/throw_exception.hpp +1 -1
  248. data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_function_ptr_helper.hpp +27 -27
  249. data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp +27 -27
  250. data/src/cxx_supportlib/vendor-modified/boost/type_traits/intrinsics.hpp +22 -8
  251. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/fca.hpp +37 -7
  252. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa.hpp +1921 -0
  253. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/implementation.hpp +66 -82
  254. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/prime_fmod.hpp +6 -0
  255. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/type_traits.hpp +109 -0
  256. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/xmx.hpp +75 -0
  257. data/src/cxx_supportlib/vendor-modified/boost/unordered/hash_traits.hpp +45 -0
  258. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map.hpp +732 -0
  259. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map_fwd.hpp +49 -0
  260. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set.hpp +586 -0
  261. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set_fwd.hpp +49 -0
  262. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map.hpp +166 -66
  263. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set.hpp +145 -28
  264. data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
  265. data/src/cxx_supportlib/vendor-modified/websocketpp/websocketpp/common/md5.hpp +1 -1
  266. data/src/ruby_native_extension/extconf.rb +1 -1
  267. data/src/ruby_supportlib/phusion_passenger/platform_info/operating_system.rb +1 -1
  268. data/src/ruby_supportlib/phusion_passenger.rb +5 -5
  269. metadata +36 -19
  270. data/src/cxx_supportlib/vendor-modified/boost/align/align.hpp +0 -19
  271. data/src/cxx_supportlib/vendor-modified/boost/align/alignment_of.hpp +0 -54
  272. data/src/cxx_supportlib/vendor-modified/boost/align/alignment_of_forward.hpp +0 -20
  273. data/src/cxx_supportlib/vendor-modified/boost/align/detail/align_cxx11.hpp +0 -21
  274. data/src/cxx_supportlib/vendor-modified/boost/align/detail/aligned_alloc.hpp +0 -52
  275. data/src/cxx_supportlib/vendor-modified/boost/align/detail/alignment_of.hpp +0 -31
  276. data/src/cxx_supportlib/vendor-modified/boost/align/detail/alignment_of_cxx11.hpp +0 -23
  277. data/src/cxx_supportlib/vendor-modified/boost/align/detail/element_type.hpp +0 -91
  278. data/src/cxx_supportlib/vendor-modified/boost/align/detail/integral_constant.hpp +0 -53
  279. data/src/cxx_supportlib/vendor-modified/boost/align/detail/min_size.hpp +0 -26
  280. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/completion_handler_erasure.hpp +0 -196
  281. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/compose.hpp +0 -709
  282. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/float_functions.hpp +0 -336
  283. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_float.hpp +0 -271
  284. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/limits.hpp +0 -62
  285. data/src/cxx_supportlib/vendor-modified/boost/container_hash/extensions.hpp +0 -361
  286. data/src/cxx_supportlib/vendor-modified/boost/detail/container_fwd.hpp +0 -157
@@ -16,7 +16,9 @@
16
16
  #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
17
 
18
18
  #include <boost/asio/detail/config.hpp>
19
+ #include <vector>
19
20
  #include <boost/asio/detail/array.hpp>
21
+ #include <boost/asio/detail/memory.hpp>
20
22
  #include <boost/asio/detail/utility.hpp>
21
23
  #include <boost/asio/experimental/cancellation_condition.hpp>
22
24
 
@@ -79,8 +81,57 @@ template <typename Condition, typename Handler,
79
81
  void parallel_group_launch(Condition cancellation_condition, Handler handler,
80
82
  std::tuple<Ops...>& ops, boost::asio::detail::index_sequence<I...>);
81
83
 
84
+ // Helper trait for determining ranged parallel group completion signatures.
85
+
86
+ template <typename Signature, typename Allocator>
87
+ struct ranged_parallel_group_signature;
88
+
89
+ template <typename R, typename... Args, typename Allocator>
90
+ struct ranged_parallel_group_signature<R(Args...), Allocator>
91
+ {
92
+ typedef std::vector<std::size_t,
93
+ BOOST_ASIO_REBIND_ALLOC(Allocator, std::size_t)> order_type;
94
+ typedef R raw_type(
95
+ std::vector<Args, BOOST_ASIO_REBIND_ALLOC(Allocator, Args)>...);
96
+ typedef R type(order_type,
97
+ std::vector<Args, BOOST_ASIO_REBIND_ALLOC(Allocator, Args)>...);
98
+ };
99
+
100
+ template <typename Condition, typename Handler,
101
+ typename Range, typename Allocator>
102
+ void ranged_parallel_group_launch(Condition cancellation_condition,
103
+ Handler handler, Range&& range, const Allocator& allocator);
104
+
105
+ char (&parallel_group_has_iterator_helper(...))[2];
106
+
107
+ template <typename T>
108
+ char parallel_group_has_iterator_helper(T*, typename T::iterator* = 0);
109
+
110
+ template <typename T>
111
+ struct parallel_group_has_iterator_typedef
112
+ {
113
+ enum { value = (sizeof((parallel_group_has_iterator_helper)((T*)(0))) == 1) };
114
+ };
115
+
82
116
  } // namespace detail
83
117
 
118
+ /// Type trait used to determine whether a type is a range of asynchronous
119
+ /// operations that can be used with with @c make_parallel_group.
120
+ template <typename T>
121
+ struct is_async_operation_range
122
+ {
123
+ #if defined(GENERATING_DOCUMENTATION)
124
+ /// The value member is true if the type may be used as a range of
125
+ /// asynchronous operations.
126
+ static const bool value;
127
+ #else
128
+ enum
129
+ {
130
+ value = detail::parallel_group_has_iterator_typedef<T>::value
131
+ };
132
+ #endif
133
+ };
134
+
84
135
  /// A group of asynchronous operations that may be launched in parallel.
85
136
  /**
86
137
  * See the documentation for boost::asio::experimental::make_parallel_group for
@@ -196,6 +247,211 @@ make_parallel_group(Ops... ops)
196
247
  return parallel_group<Ops...>(std::move(ops)...);
197
248
  }
198
249
 
250
+ /// A range-based group of asynchronous operations that may be launched in
251
+ /// parallel.
252
+ /**
253
+ * See the documentation for boost::asio::experimental::make_parallel_group for
254
+ * a usage example.
255
+ */
256
+ template <typename Range, typename Allocator = std::allocator<void> >
257
+ class ranged_parallel_group
258
+ {
259
+ private:
260
+ struct initiate_async_wait
261
+ {
262
+ template <typename Handler, typename Condition>
263
+ void operator()(Handler&& h, Condition&& c,
264
+ Range&& range, const Allocator& allocator) const
265
+ {
266
+ detail::ranged_parallel_group_launch(std::move(c),
267
+ std::move(h), std::forward<Range>(range), allocator);
268
+ }
269
+ };
270
+
271
+ Range range_;
272
+ Allocator allocator_;
273
+
274
+ public:
275
+ /// Constructor.
276
+ explicit ranged_parallel_group(Range range,
277
+ const Allocator& allocator = Allocator())
278
+ : range_(std::move(range)),
279
+ allocator_(allocator)
280
+ {
281
+ }
282
+
283
+ /// The completion signature for the group of operations.
284
+ typedef typename detail::ranged_parallel_group_signature<
285
+ typename completion_signature_of<
286
+ typename std::decay<
287
+ decltype(*std::declval<typename Range::iterator>())>::type>::type,
288
+ Allocator>::type signature;
289
+
290
+ /// Initiate an asynchronous wait for the group of operations.
291
+ /**
292
+ * Launches the group and asynchronously waits for completion.
293
+ *
294
+ * @param cancellation_condition A function object, called on completion of
295
+ * an operation within the group, that is used to determine whether to cancel
296
+ * the remaining operations. The function object is passed the arguments of
297
+ * the completed operation's handler. To trigger cancellation of the remaining
298
+ * operations, it must return a boost::asio::cancellation_type value other
299
+ * than <tt>boost::asio::cancellation_type::none</tt>.
300
+ *
301
+ * @param token A @ref completion_token whose signature is comprised of
302
+ * a @c std::vector<std::size_t, Allocator> indicating the completion order of
303
+ * the operations, followed by a vector for each of the completion signature's
304
+ * arguments.
305
+ *
306
+ * The library provides the following @c cancellation_condition types:
307
+ *
308
+ * @li boost::asio::experimental::wait_for_all
309
+ * @li boost::asio::experimental::wait_for_one
310
+ * @li boost::asio::experimental::wait_for_one_error
311
+ * @li boost::asio::experimental::wait_for_one_success
312
+ */
313
+ template <typename CancellationCondition,
314
+ BOOST_ASIO_COMPLETION_TOKEN_FOR(signature) CompletionToken>
315
+ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX(CompletionToken, signature)
316
+ async_wait(CancellationCondition cancellation_condition,
317
+ CompletionToken&& token)
318
+ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE_SUFFIX((
319
+ boost::asio::async_initiate<CompletionToken, signature>(
320
+ declval<initiate_async_wait>(), token,
321
+ std::move(cancellation_condition),
322
+ std::move(range_), allocator_)))
323
+ {
324
+ return boost::asio::async_initiate<CompletionToken, signature>(
325
+ initiate_async_wait(), token,
326
+ std::move(cancellation_condition),
327
+ std::move(range_), allocator_);
328
+ }
329
+ };
330
+
331
+ /// Create a group of operations that may be launched in parallel.
332
+ /**
333
+ * @param range A range containing the operations to be launched.
334
+ *
335
+ * For example:
336
+ * @code
337
+ * using op_type = decltype(
338
+ * socket1.async_read_some(
339
+ * boost::asio::buffer(data1),
340
+ * boost::asio::deferred
341
+ * )
342
+ * );
343
+ *
344
+ * std::vector<op_type> ops;
345
+ *
346
+ * ops.push_back(
347
+ * socket1.async_read_some(
348
+ * boost::asio::buffer(data1),
349
+ * boost::asio::deferred
350
+ * )
351
+ * );
352
+ *
353
+ * ops.push_back(
354
+ * socket2.async_read_some(
355
+ * boost::asio::buffer(data2),
356
+ * boost::asio::deferred
357
+ * )
358
+ * );
359
+ *
360
+ * boost::asio::experimental::make_parallel_group(ops).async_wait(
361
+ * boost::asio::experimental::wait_for_all(),
362
+ * [](
363
+ * std::vector<std::size_t> completion_order,
364
+ * std::vector<boost::system::error_code> e,
365
+ * std::vector<std::size_t> n
366
+ * )
367
+ * {
368
+ * for (std::size_t i = 0; i < completion_order.size(); ++i)
369
+ * {
370
+ * std::size_t idx = completion_order[i];
371
+ * std::cout << "socket " << idx << " finished: ";
372
+ * std::cout << e[idx] << ", " << n[idx] << "\n";
373
+ * }
374
+ * }
375
+ * );
376
+ * @endcode
377
+ */
378
+ template <typename Range>
379
+ BOOST_ASIO_NODISCARD inline
380
+ ranged_parallel_group<typename std::decay<Range>::type>
381
+ make_parallel_group(Range&& range,
382
+ typename constraint<
383
+ is_async_operation_range<typename std::decay<Range>::type>::value
384
+ >::type = 0)
385
+ {
386
+ return ranged_parallel_group<typename std::decay<Range>::type>(
387
+ std::forward<Range>(range));
388
+ }
389
+
390
+ /// Create a group of operations that may be launched in parallel.
391
+ /**
392
+ * @param allocator Specifies the allocator to be used with the result vectors.
393
+ *
394
+ * @param range A range containing the operations to be launched.
395
+ *
396
+ * For example:
397
+ * @code
398
+ * using op_type = decltype(
399
+ * socket1.async_read_some(
400
+ * boost::asio::buffer(data1),
401
+ * boost::asio::deferred
402
+ * )
403
+ * );
404
+ *
405
+ * std::vector<op_type> ops;
406
+ *
407
+ * ops.push_back(
408
+ * socket1.async_read_some(
409
+ * boost::asio::buffer(data1),
410
+ * boost::asio::deferred
411
+ * )
412
+ * );
413
+ *
414
+ * ops.push_back(
415
+ * socket2.async_read_some(
416
+ * boost::asio::buffer(data2),
417
+ * boost::asio::deferred
418
+ * )
419
+ * );
420
+ *
421
+ * boost::asio::experimental::make_parallel_group(
422
+ * std::allocator_arg_t,
423
+ * my_allocator,
424
+ * ops
425
+ * ).async_wait(
426
+ * boost::asio::experimental::wait_for_all(),
427
+ * [](
428
+ * std::vector<std::size_t> completion_order,
429
+ * std::vector<boost::system::error_code> e,
430
+ * std::vector<std::size_t> n
431
+ * )
432
+ * {
433
+ * for (std::size_t i = 0; i < completion_order.size(); ++i)
434
+ * {
435
+ * std::size_t idx = completion_order[i];
436
+ * std::cout << "socket " << idx << " finished: ";
437
+ * std::cout << e[idx] << ", " << n[idx] << "\n";
438
+ * }
439
+ * }
440
+ * );
441
+ * @endcode
442
+ */
443
+ template <typename Allocator, typename Range>
444
+ BOOST_ASIO_NODISCARD inline
445
+ ranged_parallel_group<typename std::decay<Range>::type, Allocator>
446
+ make_parallel_group(allocator_arg_t, const Allocator& allocator, Range&& range,
447
+ typename constraint<
448
+ is_async_operation_range<typename std::decay<Range>::type>::value
449
+ >::type = 0)
450
+ {
451
+ return ranged_parallel_group<typename std::decay<Range>::type, Allocator>(
452
+ std::forward<Range>(range), allocator);
453
+ }
454
+
199
455
  } // namespace experimental
200
456
  } // namespace asio
201
457
  } // namespace boost
@@ -20,14 +20,14 @@
20
20
  #include <boost/asio/detail/type_traits.hpp>
21
21
  #include <boost/asio/any_io_executor.hpp>
22
22
  #include <boost/asio/associated_cancellation_slot.hpp>
23
+ #include <boost/asio/associated_executor.hpp>
23
24
  #include <boost/asio/bind_executor.hpp>
24
25
  #include <boost/asio/cancellation_signal.hpp>
25
- #include <boost/asio/experimental/detail/completion_handler_erasure.hpp>
26
+ #include <boost/asio/dispatch.hpp>
26
27
  #include <boost/asio/experimental/impl/promise.hpp>
27
28
  #include <boost/asio/post.hpp>
28
29
 
29
30
  #include <algorithm>
30
- #include <variant>
31
31
 
32
32
  #include <boost/asio/detail/push_options.hpp>
33
33
 
@@ -35,11 +35,6 @@ namespace boost {
35
35
  namespace asio {
36
36
  namespace experimental {
37
37
 
38
- template <typename Executor = any_io_executor>
39
- struct use_promise_t {};
40
-
41
- constexpr use_promise_t<> use_promise;
42
-
43
38
  template <typename T>
44
39
  struct is_promise : std::false_type {};
45
40
 
@@ -64,40 +59,49 @@ struct promise_value_type<T>
64
59
  template <>
65
60
  struct promise_value_type<>
66
61
  {
67
- using type = std::monostate;
62
+ using type = std::tuple<>;
68
63
  };
69
64
 
70
65
  #if defined(GENERATING_DOCUMENTATION)
71
- /// The primary template is not defined.
72
- template<typename Signature = void(), typename Executor = any_io_executor>
66
+ /// A disposable handle for an eager operation.
67
+ /**
68
+ * @tparam Signature The signature of the operation.
69
+ *
70
+ * @tparam Executor The executor to be used by the promise (taken from the
71
+ * operation).
72
+ *
73
+ * @tparam Allocator The allocator used for the promise. Can be set through
74
+ * use_allocator.
75
+ *
76
+ * A promise can be used to initiate an asynchronous option that can be
77
+ * completed later. If the promise gets destroyed before completion, the
78
+ * operation gets a cancel signal and the result is ignored.
79
+ *
80
+ * A promise fulfills the requirements of async_operation.
81
+ *
82
+ * @par Examples
83
+ * Reading and writing from one coroutine.
84
+ * @code
85
+ * awaitable<void> read_write_some(boost::asio::ip::tcp::socket & sock,
86
+ * boost::asio::mutable_buffer read_buf, boost::asio::const_buffer to_write)
87
+ * {
88
+ * auto p = boost::asio::async_read(read_buf, boost::asio::use_awaitable);
89
+ * co_await boost::asio::async_write_some(to_write, boost::asio::deferred);
90
+ * co_await p;
91
+ * }
92
+ * @endcode
93
+ */
94
+ template<typename Signature = void(),
95
+ typename Executor = boost::asio::any_io_executor,
96
+ typename Allocator = std::allocator<void>>
73
97
  struct promise
74
- {
75
- };
98
+ #else
99
+ template <typename ... Ts, typename Executor, typename Allocator>
100
+ struct promise<void(Ts...), Executor, Allocator>
76
101
  #endif // defined(GENERATING_DOCUMENTATION)
77
-
78
- template <typename ... Ts, typename Executor>
79
- struct promise<void(Ts...), Executor>
80
102
  {
103
+ /// The value that's returned by the promise.
81
104
  using value_type = typename promise_value_type<Ts...>::type;
82
- using tuple_type = std::tuple<Ts...>;
83
- using executor_type = Executor;
84
-
85
- /// Rebinds the promise type to another executor.
86
- template <typename Executor1>
87
- struct rebind_executor
88
- {
89
- /// The file type when rebound to the specified executor.
90
- typedef promise<void(Ts...), Executor1> other;
91
- };
92
-
93
- /// Get the executor of the promise
94
- executor_type get_executor() const
95
- {
96
- if (impl_)
97
- return impl_->executor;
98
- else
99
- return {};
100
- }
101
105
 
102
106
  /// Cancel the promise. Usually done through the destructor.
103
107
  void cancel(cancellation_type level = cancellation_type::all)
@@ -105,22 +109,20 @@ struct promise<void(Ts...), Executor>
105
109
  if (impl_ && !impl_->done)
106
110
  {
107
111
  boost::asio::dispatch(impl_->executor,
108
- [level, impl = impl_]{impl->cancel.emit(level);});
112
+ [level, impl = impl_]{ impl->cancel.emit(level); });
109
113
  }
110
114
  }
111
115
 
112
116
  /// Check if the promise is completed already.
113
- bool complete() const noexcept
117
+ bool completed() const noexcept
114
118
  {
115
119
  return impl_ && impl_->done;
116
120
  }
117
121
 
118
122
  /// Wait for the promise to become ready.
119
- template <
120
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void(Ts...)) CompletionToken
121
- BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
122
- auto async_wait(CompletionToken&& token
123
- BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
123
+ template <BOOST_ASIO_COMPLETION_TOKEN_FOR(void(Ts...)) CompletionToken>
124
+ inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(Ts...))
125
+ operator()(CompletionToken&& token)
124
126
  {
125
127
  assert(impl_);
126
128
 
@@ -132,37 +134,52 @@ struct promise<void(Ts...), Executor>
132
134
  promise(const promise& ) = delete;
133
135
  promise(promise&& ) noexcept = default;
134
136
 
137
+ /// Destruct the promise and cancel the operation.
138
+ /**
139
+ * It is safe to destruct a promise of a promise that didn't complete.
140
+ */
135
141
  ~promise() { cancel(); }
136
142
 
137
143
 
138
144
  private:
139
145
  #if !defined(GENERATING_DOCUMENTATION)
140
- template <typename, typename> friend struct promise;
141
- friend struct detail::promise_handler<void(Ts...)>;
146
+ template <typename, typename, typename> friend struct promise;
147
+ friend struct detail::promise_handler<void(Ts...), Executor, Allocator>;
142
148
  #endif // !defined(GENERATING_DOCUMENTATION)
143
149
 
144
- std::shared_ptr<detail::promise_impl<void(Ts...), Executor>> impl_;
145
- promise(std::shared_ptr<detail::promise_impl<void(Ts...), Executor>> impl)
150
+ std::shared_ptr<detail::promise_impl<
151
+ void(Ts...), Executor, Allocator>> impl_;
152
+
153
+ promise(
154
+ std::shared_ptr<detail::promise_impl<
155
+ void(Ts...), Executor, Allocator>> impl)
146
156
  : impl_(impl)
147
157
  {
148
158
  }
149
159
 
150
160
  struct initiate_async_wait
151
161
  {
152
- std::shared_ptr<detail::promise_impl<void(Ts...), Executor>> self_;
162
+ std::shared_ptr<detail::promise_impl<
163
+ void(Ts...), Executor, Allocator>> self_;
153
164
 
154
165
  template <typename WaitHandler>
155
166
  void operator()(WaitHandler&& handler) const
156
167
  {
157
- const auto exec = get_associated_executor(handler, self_->executor);
168
+ const auto alloc = get_associated_allocator(
169
+ handler, self_->get_allocator());
170
+
158
171
  auto cancel = get_associated_cancellation_slot(handler);
172
+
159
173
  if (self_->done)
160
174
  {
175
+ auto exec = boost::asio::get_associated_executor(
176
+ handler, self_->get_executor());
177
+
161
178
  boost::asio::post(exec,
162
- [self = self_, h = std::forward<WaitHandler>(handler)]() mutable
179
+ [self = std::move(self_),
180
+ handler = std::forward<WaitHandler>(handler)]() mutable
163
181
  {
164
- std::apply(std::forward<WaitHandler>(h),
165
- std::move(*self->result));
182
+ self->apply(std::move(handler));
166
183
  });
167
184
  }
168
185
  else
@@ -171,26 +188,29 @@ private:
171
188
  {
172
189
  struct cancel_handler
173
190
  {
174
- std::weak_ptr<detail::promise_impl<void(Ts...), Executor>> self;
191
+ std::weak_ptr<detail::promise_impl<
192
+ void(Ts...), Executor, Allocator>> self;
175
193
 
176
194
  cancel_handler(
177
- std::weak_ptr<detail::promise_impl<void(Ts...), Executor>> self)
195
+ std::weak_ptr<detail::promise_impl<
196
+ void(Ts...), Executor, Allocator>> self)
178
197
  : self(std::move(self))
179
198
  {
180
199
  }
181
200
 
182
201
  void operator()(cancellation_type level) const
183
202
  {
184
- if (auto p = self.lock(); p != nullptr)
203
+ if (auto p = self.lock())
204
+ {
185
205
  p->cancel.emit(level);
186
-
206
+ p->cancel_();
207
+ }
187
208
  }
188
209
  };
189
-
190
210
  cancel.template emplace<cancel_handler>(self_);
191
211
  }
192
212
 
193
- self_->completion = {exec, std::forward<WaitHandler>(handler)};
213
+ self_->set_completion(alloc, std::forward<WaitHandler>(handler));
194
214
  }
195
215
  }
196
216
  };
@@ -198,30 +218,6 @@ private:
198
218
 
199
219
  } // namespace experimental
200
220
 
201
- #if !defined(GENERATING_DOCUMENTATION)
202
-
203
- template <typename Executor, typename R, typename... Args>
204
- struct async_result<experimental::use_promise_t<Executor>, R(Args...)>
205
- {
206
- using handler_type = experimental::detail::promise_handler<
207
- void(typename decay<Args>::type...), Executor>;
208
-
209
- using return_type = experimental::promise<
210
- void(typename decay<Args>::type...), Executor>;
211
-
212
- template <typename Initiation, typename... InitArgs>
213
- static auto initiate(Initiation initiation,
214
- experimental::use_promise_t<Executor>, InitArgs... args)
215
- -> typename handler_type::promise_type
216
- {
217
- handler_type ht{get_associated_executor(initiation)};
218
- std::move(initiation)(ht, std::move(args)...);
219
- return ht.make_promise();
220
- }
221
- };
222
-
223
- #endif // !defined(GENERATING_DOCUMENTATION)
224
-
225
221
  } // namespace asio
226
222
  } // namespace boost
227
223
 
@@ -17,11 +17,9 @@
17
17
  #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18
18
 
19
19
  #include <boost/asio/detail/config.hpp>
20
- #include <optional>
21
- #include <boost/asio/bind_cancellation_slot.hpp>
22
- #include <boost/asio/bind_executor.hpp>
23
- #include <boost/system/error_code.hpp>
24
- #include <boost/asio/experimental/detail/partial_promise.hpp>
20
+ #include <memory>
21
+ #include <boost/asio/deferred.hpp>
22
+ #include <boost/asio/detail/source_location.hpp>
25
23
 
26
24
  #include <boost/asio/detail/push_options.hpp>
27
25
 
@@ -32,8 +30,7 @@ class any_io_executor;
32
30
 
33
31
  namespace experimental {
34
32
 
35
- /// A @ref completion_token that represents the currently executing resumable
36
- /// coroutine.
33
+ /// A @ref completion_token that creates another coro for the task completion.
37
34
  /**
38
35
  * The @c use_coro_t class, with its value @c use_coro, is used to represent an
39
36
  * operation that can be awaited by the current resumable coroutine. This
@@ -50,26 +47,36 @@ namespace experimental {
50
47
  * above example) suspends the current coroutine. The coroutine is resumed when
51
48
  * the asynchronous operation completes, and the result of the operation is
52
49
  * returned.
50
+ *
51
+ * Note that this token is not the most efficient (use @c boost::asio::deferred
52
+ * for that) but does provide type erasure, as it will always return a @c coro.
53
53
  */
54
- template <typename Executor = any_io_executor>
54
+ template <typename Allocator = std::allocator<void>>
55
55
  struct use_coro_t
56
56
  {
57
+
58
+ /// The allocator type. The allocator is used when constructing the
59
+ /// @c std::promise object for a given asynchronous operation.
60
+ typedef Allocator allocator_type;
61
+
57
62
  /// Default constructor.
58
63
  BOOST_ASIO_CONSTEXPR use_coro_t(
64
+ allocator_type allocator = allocator_type{}
59
65
  #if defined(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
60
66
  # if defined(BOOST_ASIO_HAS_SOURCE_LOCATION)
61
- boost::asio::detail::source_location location =
67
+ , boost::asio::detail::source_location location =
62
68
  boost::asio::detail::source_location::current()
63
69
  # endif // defined(BOOST_ASIO_HAS_SOURCE_LOCATION)
64
70
  #endif // defined(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
65
71
  )
72
+ : allocator_(allocator)
66
73
  #if defined(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
67
74
  # if defined(BOOST_ASIO_HAS_SOURCE_LOCATION)
68
- : file_name_(location.file_name()),
75
+ , file_name_(location.file_name()),
69
76
  line_(location.line()),
70
77
  function_name_(location.function_name())
71
78
  # else // defined(BOOST_ASIO_HAS_SOURCE_LOCATION)
72
- : file_name_(0),
79
+ , file_name_(0),
73
80
  line_(0),
74
81
  function_name_(0)
75
82
  # endif // defined(BOOST_ASIO_HAS_SOURCE_LOCATION)
@@ -77,14 +84,30 @@ struct use_coro_t
77
84
  {
78
85
  }
79
86
 
87
+
88
+ /// Specify an alternate allocator.
89
+ template <typename OtherAllocator>
90
+ use_coro_t<OtherAllocator> rebind(const OtherAllocator& allocator) const
91
+ {
92
+ return use_future_t<OtherAllocator>(allocator);
93
+ }
94
+
95
+ /// Obtain allocator.
96
+ allocator_type get_allocator() const
97
+ {
98
+ return allocator_;
99
+ }
100
+
80
101
  /// Constructor used to specify file name, line, and function name.
81
102
  BOOST_ASIO_CONSTEXPR use_coro_t(const char* file_name,
82
- int line, const char* function_name)
103
+ int line, const char* function_name,
104
+ allocator_type allocator = allocator_type{}) :
83
105
  #if defined(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
84
- : file_name_(file_name),
106
+ file_name_(file_name),
85
107
  line_(line),
86
- function_name_(function_name)
108
+ function_name_(function_name),
87
109
  #endif // defined(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
110
+ allocator_(allocator)
88
111
  {
89
112
  #if !defined(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
90
113
  (void)file_name;
@@ -144,6 +167,9 @@ struct use_coro_t
144
167
  int line_;
145
168
  const char* function_name_;
146
169
  #endif // defined(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
170
+
171
+ private:
172
+ Allocator allocator_;
147
173
  };
148
174
 
149
175
  /// A @ref completion_token object that represents the currently executing