From a6cf03a6ae98e4fb675da25046d148e92bcf7206 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 16 Sep 2026 15:00:46 -0400 Subject: chore: staticcheck and gofmt cleanups --- internal/engine/tick.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/engine') diff --git a/internal/engine/tick.go b/internal/engine/tick.go index 74b1dcf..63ee6af 100644 --- a/internal/engine/tick.go +++ b/internal/engine/tick.go @@ -99,8 +99,11 @@ func (e *Engine) Stop() { // before owned state is saved. func (e *Engine) StopAndWait() { e.Stop() + // Join any in-flight tick: processTick holds tickMu for its whole body, + // so acquiring the mutex blocks until the running callback completes; + // holding it until return keeps that guarantee for the caller. e.tickMu.Lock() - e.tickMu.Unlock() + defer e.tickMu.Unlock() } // Tick fires every due subscriber synchronously and returns. Subscribers -- cgit v1.2.3