From 7c9bec7b9c3286826fcaf19318a09440c93aaf26 Mon Sep 17 00:00:00 2001 From: Latent Prion Date: Sat, 11 Jul 2026 18:26:54 -0400 Subject: [PATCH] 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 --- include/spinscale/syncCancelerForAsyncWork.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/spinscale/syncCancelerForAsyncWork.h b/include/spinscale/syncCancelerForAsyncWork.h index e186542..83396d7 100644 --- a/include/spinscale/syncCancelerForAsyncWork.h +++ b/include/spinscale/syncCancelerForAsyncWork.h @@ -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