docs: warn against destroy() on mid-flight task/quitter handles#276
docs: warn against destroy() on mid-flight task/quitter handles#276sgerbino merged 1 commit intocppalliance:developfrom
Conversation
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.
|
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 |
|
GCOVR code coverage report https://276.capy.prtest3.cppalliance.org/gcovr/index.html Build time: 2026-05-07 16:41:57 UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #276 +/- ##
========================================
Coverage 92.37% 92.37%
========================================
Files 168 168
Lines 9414 9414
========================================
Hits 8696 8696
Misses 718 718
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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.