]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.16] 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:27:54 +0000 (23:27 +0000)
commit552410fec2c662b8cc003c27b239d8b5bb11fcd7
treed3e7fa678d35eebe4f477aca96a1ce073ce36319
parent170a72e58bd128b421f4b3974fe2a37fd035efdf
[release-branch.go1.16] 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 #47858

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/+/350000
src/runtime/time.go
src/time/sleep_test.go