Skip to content

docs: warn against destroy() on mid-flight task/quitter handles#276

Merged
sgerbino merged 1 commit intocppalliance:developfrom
sgerbino:pr/doc-destroy
May 7, 2026
Merged

docs: warn against destroy() on mid-flight task/quitter handles#276
sgerbino merged 1 commit intocppalliance:developfrom
sgerbino:pr/doc-destroy

Conversation

@sgerbino
Copy link
Copy Markdown
Collaborator

@sgerbino sgerbino commented May 7, 2026

task::handle(), quitter::handle(), and the matching release() methods are public, but calling coroutine_handle::destroy() on a suspended task or quitter that another coroutine is awaiting produces undefined behavior: the io_awaitable_promise_base destructor cascades through the parent's continuation while the parent's destruction is already in progress.

Document the constraint where users will encounter it (Doxygen on handle() and release(), and a new "Why Not coroutine_handle::destroy()?" subsection in the cancellation chapter), and clarify the destructor's contract in io_awaitable_promise_base. No behavior change.

task::handle(), quitter::handle(), and the matching release() methods
are public, but calling coroutine_handle::destroy() on a suspended
task or quitter that another coroutine is awaiting produces undefined
behavior: the io_awaitable_promise_base destructor cascades through
the parent's continuation while the parent's destruction is already
in progress.

Document the constraint where users will encounter it (Doxygen on
handle() and release(), and a new "Why Not coroutine_handle::destroy()?"
subsection in the cancellation chapter), and clarify the destructor's
contract in io_awaitable_promise_base. No behavior change.
@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://276.capy.prtest3.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-05-07 16:27:12 UTC

@cppalliance-bot
Copy link
Copy Markdown

GCOVR code coverage report https://276.capy.prtest3.cppalliance.org/gcovr/index.html
LCOV code coverage report https://276.capy.prtest3.cppalliance.org/genhtml/index.html
Coverage Diff Report https://276.capy.prtest3.cppalliance.org/diff-report/index.html

Build time: 2026-05-07 16:41:57 UTC

@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.37%. Comparing base (55090d1) to head (452ea00).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #276   +/-   ##
========================================
  Coverage    92.37%   92.37%           
========================================
  Files          168      168           
  Lines         9414     9414           
========================================
  Hits          8696     8696           
  Misses         718      718           
Flag Coverage Δ
linux 92.36% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...nclude/boost/capy/ex/io_awaitable_promise_base.hpp 92.10% <ø> (ø)
include/boost/capy/quitter.hpp 93.81% <ø> (ø)
include/boost/capy/task.hpp 96.15% <ø> (ø)

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 55090d1...452ea00. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sgerbino sgerbino merged commit 81a78e2 into cppalliance:develop May 7, 2026
38 of 39 checks passed
@sgerbino sgerbino deleted the pr/doc-destroy branch May 7, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants