diff options
| author | historia <[not public]> | 2026-09-16 15:00:46 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-16 15:00:46 -0400 |
| commit | a6cf03a6ae98e4fb675da25046d148e92bcf7206 (patch) | |
| tree | 194499fe9e696be8c31cd915b7ad92678f9f95e0 /internal/engine | |
| parent | 9192d94dea6be5498ab080f3e2df5667af871d7a (diff) | |
| download | thehouseoficarus-a6cf03a6ae98e4fb675da25046d148e92bcf7206.tar.gz | |
chore: staticcheck and gofmt cleanups
Diffstat (limited to 'internal/engine')
| -rw-r--r-- | internal/engine/tick.go | 5 |
1 files changed, 4 insertions, 1 deletions
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 |
