aboutsummaryrefslogtreecommitdiff
path: root/internal/engine/tick.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-16 15:00:46 -0400
committerhistoria <[not public]>2026-09-16 15:00:46 -0400
commita6cf03a6ae98e4fb675da25046d148e92bcf7206 (patch)
tree194499fe9e696be8c31cd915b7ad92678f9f95e0 /internal/engine/tick.go
parent9192d94dea6be5498ab080f3e2df5667af871d7a (diff)
downloadthehouseoficarus-a6cf03a6ae98e4fb675da25046d148e92bcf7206.tar.gz
chore: staticcheck and gofmt cleanups
Diffstat (limited to 'internal/engine/tick.go')
-rw-r--r--internal/engine/tick.go5
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