Skip to content

Commit

Permalink
JitterTicker.Stop() better about preventing a 'stale' tick
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenaw committed Sep 10, 2023
1 parent d72bc66 commit bed6bf7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions xtime/xtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ func (t *JitterTicker) Reset(d time.Duration, jitter time.Duration) {
func (t *JitterTicker) Stop() {
t.m.Lock()
t.timer.Stop()
t.gen++
t.timer = nil
t.m.Unlock()
}

0 comments on commit bed6bf7

Please sign in to comment.