]> Cypherpunks repositories - gostls13.git/commit
runtime: in adjustTimers back up as far as necessary
authorIan Lance Taylor <iant@golang.org>
Fri, 20 Aug 2021 23:55:04 +0000 (16:55 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 15 Sep 2021 00:56:40 +0000 (00:56 +0000)
commit2da3375e9b4980e368a8641f54cc53c4af4d1a12
tree8a649d4a9791c9f536b1d8119322fd63048e5df5
parentc7f2f51fed15b410dea5f608420858b401887d0a
runtime: in adjustTimers back up as far as necessary

When the adjustTimers function removed a timer it assumed it was
sufficient to continue the heap traversal at that position.
However, in some cases a timer will be moved to an earlier
position in the heap. If that timer is timerModifiedEarlier,
that can leave timerModifiedEarliest not correctly representing
the earlier such timer.

Fix the problem by restarting the heap traversal at the earliest
changed position.

Fixes #47762

Change-Id: I152bbe62793ee40a680baf49967bcb89b1f94764
Reviewed-on: https://go-review.googlesource.com/c/go/+/343882
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/time.go
src/time/sleep_test.go