runtime: convert schedt.gcwaiting to atomic type

Note that this replaces numerous unsynchronized loads throughout the
scheduler.

For #53821.

Change-Id: Ica80b04c9e8c184bfef186e549526fc3f117c387
Reviewed-on: https://go-review.googlesource.com/c/go/+/419447
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:
Michael Pratt 2022-07-25 15:31:03 -04:00
parent 1eeef5d5b4
commit 88ef50e662
3 changed files with 15 additions and 15 deletions

View file

@ -817,7 +817,7 @@ type schedt struct {
// m.exited is set. Linked through m.freelink.
freem *m
gcwaiting uint32 // gc is waiting to run
gcwaiting atomic.Bool // gc is waiting to run
stopwait int32
stopnote note
sysmonwait uint32