From 58a1dabfd1b2bbc2a6a9a2e1cda3e98d93d61258 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 20 Jul 2022 18:01:31 -0400 Subject: 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 Reviewed-by: Austin Clements Run-TryBot: Michael Pratt --- src/runtime/runtime2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/runtime/runtime2.go') 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. -- cgit v1.3