spinscale: document slot-cancel-before-internal-op-cancel ordering.

Shutdown call sites must set slot cancelers before cancelling timers, I/O,
or hardware capture so callees observe stop intent when unblocked.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-11 18:26:54 -04:00
co-authored by Cursor
parent 01efbd8c94
commit 7c9bec7b9c
@@ -27,6 +27,11 @@ namespace sscl {
* then flips shouldContinue to false. This guarantees shouldContinue is stable
* throughout each uncancelable segment.
*
* Shutdown call sites that also cancel internal async operations (timers, I/O,
* hardware capture, etc.) must call requestStop() on slot cancelers before
* cancelling those internal operations, so callees observe stop intent when
* the internal op unblocks their co_await.
*
* startAcceptingWork() is intentionally unlocked. Precondition: callers must
* only call startAcceptingWork() when no async callee is running yet (e.g. at
* the end of setup(), before posting/arming the first async work). If this