aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2022-08-17 14:56:18 +0700
committerGopher Robot <gobot@golang.org>2022-08-17 18:01:43 +0000
commite1fd51e0765a5d7b2dd72b2f82b9c3eed2764035 (patch)
tree7c1891dba2197932b231a95332a97f24b723c6af /src/runtime/proc.go
parentbc805795bd28ae4cd1a70b3053a3a71668bfef87 (diff)
downloadgo-e1fd51e0765a5d7b2dd72b2f82b9c3eed2764035.tar.xz
runtime: convert p.timer0When to atomic type
Updates #53821 Change-Id: I523ec61116d290ecf7b7e3eb96e468695766cb4d Reviewed-on: https://go-review.googlesource.com/c/go/+/424396 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r--src/runtime/proc.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index b57644cc21..f100e321d4 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -3329,7 +3329,7 @@ func dropg() {
func checkTimers(pp *p, now int64) (rnow, pollUntil int64, ran bool) {
// If it's not yet time for the first timer, or the first adjusted
// timer, then there is nothing to do.
- next := int64(atomic.Load64(&pp.timer0When))
+ next := int64(pp.timer0When.Load())
nextAdj := int64(atomic.Load64(&pp.timerModifiedEarliest))
if next == 0 || (nextAdj != 0 && nextAdj < next) {
next = nextAdj
@@ -4787,7 +4787,7 @@ func (pp *p) destroy() {
pp.timers = nil
pp.numTimers = 0
pp.deletedTimers = 0
- atomic.Store64(&pp.timer0When, 0)
+ pp.timer0When.Store(0)
unlock(&pp.timersLock)
unlock(&plocal.timersLock)
}