diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-07-21 19:57:56 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-07-22 19:26:40 +0000 |
commit | 798ec73519a7226d6d436e42498a54aed23b8468 (patch) | |
tree | 905cd2ce30e34b03ce5888cd9bd9d82f86211f5e /src/runtime/runtime2.go | |
parent | fdb45acd1f062884c77ea6961fb638e004af1b8e (diff) | |
download | go-798ec73519a7226d6d436e42498a54aed23b8468.tar.gz go-798ec73519a7226d6d436e42498a54aed23b8468.zip |
runtime: don't clear timerModifiedEarliest if adjustTimers is 0
This avoids a race when a new timerModifiedEarlier timer is created by
a different goroutine.
Fixes #47329
Change-Id: I6f6c87b4a9b5491b201c725c10bc98e23e0ed9d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/336432
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>
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r-- | src/runtime/runtime2.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index 2a66826f34..8a15787382 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -681,7 +681,7 @@ type p struct { // timerModifiedEarlier status. Because the timer may have been // modified again, there need not be any timer with this value. // This is updated using atomic functions. - // This is 0 if the value is unknown. + // This is 0 if there are no timerModifiedEarlier timers. timerModifiedEarliest uint64 // Per-P GC state |