Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/continuation-rationale.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ wraps it in the embedded `continuation`, and passes that to
`co_await`).
3. Aligns with corosio's pattern, where I/O services already embed
their operation state (`scheduler_op`) in the awaitable.
4. Zero burden on task authors. `task<T>`, `quitter<T>`, and future
4. Zero burden on task authors. `task<T>` and future
task types are unchanged.
5. Cancel callbacks store `continuation*` pointing into the
awaitable, which outlives the suspension.
Expand Down
11 changes: 0 additions & 11 deletions doc/lint/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,17 +263,6 @@
"lint/.docstrings/io/any_write_stream.hpp.adoc:#4:Vale.Spelling",
"lint/.docstrings/io/write_now.hpp.adoc:#1:Vale.Spelling",
"lint/.docstrings/io/write_now.hpp.adoc:#2:Vale.Spelling",
"lint/.docstrings/quitter.hpp.adoc:#10:Vale.Spelling",
"lint/.docstrings/quitter.hpp.adoc:#1:Google.OxfordComma",
"lint/.docstrings/quitter.hpp.adoc:#1:Vale.Spelling",
"lint/.docstrings/quitter.hpp.adoc:#2:Vale.Spelling",
"lint/.docstrings/quitter.hpp.adoc:#3:Vale.Spelling",
"lint/.docstrings/quitter.hpp.adoc:#4:Vale.Spelling",
"lint/.docstrings/quitter.hpp.adoc:#5:Vale.Spelling",
"lint/.docstrings/quitter.hpp.adoc:#6:Vale.Spelling",
"lint/.docstrings/quitter.hpp.adoc:#7:Vale.Spelling",
"lint/.docstrings/quitter.hpp.adoc:#8:Vale.Spelling",
"lint/.docstrings/quitter.hpp.adoc:#9:Vale.Spelling",
"lint/.docstrings/task.hpp.adoc:#1:Google.OxfordComma",
"lint/.docstrings/task.hpp.adoc:#1:Vale.Spelling",
"lint/.docstrings/task.hpp.adoc:#2:Vale.Spelling",
Expand Down
4 changes: 2 additions & 2 deletions doc/modules/ROOT/pages/4.coroutines/4f.cancellation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@

`std::coroutine_handle::destroy()` is the {cpp}20 primitive that frees a xref:glossary.adoc#coroutine-frame[coroutine frame]. It is not a cancellation mechanism. It has the same flaw as forceful thread interruption. The coroutine is torn down with no opportunity to complete pending I/O, release locks, or run RAII destructors in the expected order.

Capy exposes cpp:task::handle[handle]`()` and cpp:quitter::handle[handle]`()` so that Capy's own launchers (cpp:run_async[], cpp:run[]) and custom integrations can dispatch coroutines through xref:glossary.adoc#executor[executors]. Calling `destroy()` on such a handle while the coroutine is being awaited by a parent produces undefined behavior: the parent still holds the frame and will destroy it again. A holder that must give up a suspended coroutine for good, such as an xref:glossary.adoc#execution-context[execution context] being torn down, passes its xref:glossary.adoc#continuation[continuation] to cpp:abandon[] instead, which unwinds the chain from the top on its owner's executor.
Capy exposes cpp:task::handle[handle]`()` so that Capy's own launchers (cpp:run_async[], cpp:run[]) and custom integrations can dispatch coroutines through xref:glossary.adoc#executor[executors]. Calling `destroy()` on such a handle while the coroutine is being awaited by a parent produces undefined behavior: the parent still holds the frame and will destroy it again. A holder that must give up a suspended coroutine for good, such as an xref:glossary.adoc#execution-context[execution context] being torn down, passes its xref:glossary.adoc#continuation[continuation] to cpp:abandon[] instead, which unwinds the chain from the top on its owner's executor.

Check warning on line 162 in doc/modules/ROOT/pages/4.coroutines/4f.cancellation.adoc

View workflow job for this annotation

GitHub Actions / Antora Docs

[vale_adoc Capy.SimpleTense] Avoid needless future/perfect tense — prefer present simple (style guide C4): 'will '.

The rule:

* To cancel work, request a stop on a `std::stop_source` whose token the work observes. The work unwinds cleanly through `final_suspend` and any RAII guards run in the correct order.
* Do not call `destroy()` on a handle returned by cpp:task::handle[handle]`()` or cpp:quitter::handle[handle]`()` while the coroutine is being awaited.
* Do not call `destroy()` on a handle returned by cpp:task::handle[handle]`()` while the coroutine is being awaited.

== Responding to Cancellation

Expand Down
6 changes: 0 additions & 6 deletions doc/modules/ROOT/pages/glossary.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,6 @@ any amount of data.
The object inside a coroutine frame that controls the coroutine's behavior,
such as how it starts, finishes, and stores its result.

== Q

[[quitter]]Quitter::
A task-like coroutine type that unwinds early when its stop token is
triggered, instead of completing its body. See cpp:quitter[].

== R

[[result]]Result::
Expand Down
5 changes: 2 additions & 3 deletions doc/mrdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ exclude-symbols:
- 'boost::capy::test::bufgrind::next_awaitable'
# Private members of anonymous unions. `inaccessible-members: never` does not
# reach variant members of an anonymous union in this MrDocs build, so they
# leak into the reference as "[variant member]" rows. In the task and quitter
# promises, `ep_` is the exception_ptr held in a union so it is not constructed
# leak into the reference as "[variant member]" rows. In the task promise,
# `ep_` is the exception_ptr held in a union so it is not constructed
# or destroyed automatically. Its sibling `has_ep_`/`state_` -- private but not
# in a union -- is correctly filtered, which is what identifies the union as
# the cause. The `**` spans the unnamed union's own scope, which sits between
# the class and the members.
- 'boost::capy::task::**::ep_'
- 'boost::capy::quitter::**::ep_'
implementation-defined:
- 'boost::capy::detail'
- 'boost::capy::*::detail'
Expand Down
Loading
Loading