mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: convert schedt.lastpoll to atomic type
Note that this changes the type from uint64 to int64, the type used by nanotime(). It also adds an atomic load in pollWork(), which used to use a non-atomic load. For #53821. Change-Id: I6173c90f20bfdc0e0a4bc3a7b1c798d1c429fff5 Reviewed-on: https://go-review.googlesource.com/c/go/+/419442 Run-TryBot: Michael Pratt <mpratt@google.com> Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
98e1648823
commit
5d7d50111f
3 changed files with 10 additions and 11 deletions
|
|
@ -760,7 +760,7 @@ type p struct {
|
|||
type schedt struct {
|
||||
// accessed atomically. keep at top to ensure alignment on 32-bit systems.
|
||||
goidgen atomic.Uint64
|
||||
lastpoll uint64 // time of last network poll, 0 if currently polling
|
||||
lastpoll atomic.Int64 // time of last network poll, 0 if currently polling
|
||||
pollUntil uint64 // time to which current poll is sleeping
|
||||
|
||||
lock mutex
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue