aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime2.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2022-07-20 18:01:31 -0400
committerMichael Pratt <mpratt@google.com>2022-08-12 01:52:06 +0000
commit58a1dabfd1b2bbc2a6a9a2e1cda3e98d93d61258 (patch)
tree00c6a0188d39e804d1d688fbcb9f838d873b10cf /src/runtime/runtime2.go
parent449691b3ef1d93125757037a9ab3f462ccab8f31 (diff)
downloadgo-58a1dabfd1b2bbc2a6a9a2e1cda3e98d93d61258.tar.xz
runtime: convert schedt.npidle to atomic type
Note that this converts npidle from uint32 to int32 for consistency with the other count fields in schedt and the type of p.id. Note that this changes previously unsynchronized operations to synchronized operations in: * handoffp * injectglist * schedtrace * schedEnableUser * sync_runtime_canSpin For #53821. Change-Id: I36d1b3b4a28131c9d47884fade6bc44439dd6937 Reviewed-on: https://go-review.googlesource.com/c/go/+/419445 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r--src/runtime/runtime2.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index bc482b00a2..7b43358ba1 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -778,7 +778,7 @@ type schedt struct {
ngsys atomic.Int32 // number of system goroutines
pidle puintptr // idle p's
- npidle uint32
+ npidle atomic.Int32
nmspinning uint32 // See "Worker thread parking/unparking" comment in proc.go.
// Global runnable queue.