@@ -95,6 +95,11 @@ struct awaitable_signature<awaitable<void, Executor>>
9595 * std::cout << "transferred " << n << "\n";
9696 * });
9797 * @endcode
98+ *
99+ * @par Per-Operation Cancellation
100+ * The new thread of execution is created with a cancellation state that
101+ * supports @c cancellation_type::terminal values only. To change the
102+ * cancellation state, call asio::this_coro::reset_cancellation_state.
98103 */
99104template <typename Executor, typename T, typename AwaitableExecutor,
100105 ASIO_COMPLETION_TOKEN_FOR (
@@ -151,6 +156,11 @@ co_spawn(const Executor& ex, awaitable<T, AwaitableExecutor> a,
151156 * echo(std::move(my_tcp_socket)),
152157 * asio::detached);
153158 * @endcode
159+ *
160+ * @par Per-Operation Cancellation
161+ * The new thread of execution is created with a cancellation state that
162+ * supports @c cancellation_type::terminal values only. To change the
163+ * cancellation state, call asio::this_coro::reset_cancellation_state.
154164 */
155165template <typename Executor, typename AwaitableExecutor,
156166 ASIO_COMPLETION_TOKEN_FOR (
@@ -215,6 +225,11 @@ co_spawn(const Executor& ex, awaitable<void, AwaitableExecutor> a,
215225 * std::cout << "transferred " << n << "\n";
216226 * });
217227 * @endcode
228+ *
229+ * @par Per-Operation Cancellation
230+ * The new thread of execution is created with a cancellation state that
231+ * supports @c cancellation_type::terminal values only. To change the
232+ * cancellation state, call asio::this_coro::reset_cancellation_state.
218233 */
219234template <typename ExecutionContext, typename T, typename AwaitableExecutor,
220235 ASIO_COMPLETION_TOKEN_FOR (
@@ -274,6 +289,11 @@ co_spawn(ExecutionContext& ctx, awaitable<T, AwaitableExecutor> a,
274289 * echo(std::move(my_tcp_socket)),
275290 * asio::detached);
276291 * @endcode
292+ *
293+ * @par Per-Operation Cancellation
294+ * The new thread of execution is created with a cancellation state that
295+ * supports @c cancellation_type::terminal values only. To change the
296+ * cancellation state, call asio::this_coro::reset_cancellation_state.
277297 */
278298template <typename ExecutionContext, typename AwaitableExecutor,
279299 ASIO_COMPLETION_TOKEN_FOR (
@@ -309,7 +329,6 @@ co_spawn(ExecutionContext& ctx, awaitable<void, AwaitableExecutor> a,
309329 * Otherwise, the function signature of the completion handler must be:
310330 * @code void handler(std::exception_ptr, R); @endcode
311331 *
312- *
313332 * @par Example
314333 * @code
315334 * asio::awaitable<std::size_t> echo(tcp::socket socket)
@@ -361,6 +380,11 @@ co_spawn(ExecutionContext& ctx, awaitable<void, AwaitableExecutor> a,
361380 * }
362381 * }, asio::detached);
363382 * @endcode
383+ *
384+ * @par Per-Operation Cancellation
385+ * The new thread of execution is created with a cancellation state that
386+ * supports @c cancellation_type::terminal values only. To change the
387+ * cancellation state, call asio::this_coro::reset_cancellation_state.
364388 */
365389template <typename Executor, typename F,
366390 ASIO_COMPLETION_TOKEN_FOR (typename detail::awaitable_signature<
@@ -392,7 +416,6 @@ co_spawn(const Executor& ex, F&& f,
392416 * Otherwise, the function signature of the completion handler must be:
393417 * @code void handler(std::exception_ptr, R); @endcode
394418 *
395- *
396419 * @par Example
397420 * @code
398421 * asio::awaitable<std::size_t> echo(tcp::socket socket)
@@ -444,6 +467,11 @@ co_spawn(const Executor& ex, F&& f,
444467 * }
445468 * }, asio::detached);
446469 * @endcode
470+ *
471+ * @par Per-Operation Cancellation
472+ * The new thread of execution is created with a cancellation state that
473+ * supports @c cancellation_type::terminal values only. To change the
474+ * cancellation state, call asio::this_coro::reset_cancellation_state.
447475 */
448476template <typename ExecutionContext, typename F,
449477 ASIO_COMPLETION_TOKEN_FOR (typename detail::awaitable_signature<
0 commit comments