]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.17] 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 23:28:10 +0000 (23:28 +0000)
commitabc4f092acf9bb65e56fcbd6ee7b2c76cee57ad7
treef00789dfa7863eb2337a1c7958552dad6dea3343
parente79c297fa80c9ddd5d3037fa1465664eea0f53c0
[release-branch.go1.17] 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.

For #47762
Fixes #47859

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>
(cherry picked from commit 2da3375e9b4980e368a8641f54cc53c4af4d1a12)
Reviewed-on: https://go-review.googlesource.com/c/go/+/350001
src/runtime/time.go
src/time/sleep_test.go