mirror of
https://github.com/golang/go.git
synced 2026-06-27 03:11:23 +00:00
runtime: fix should not compare uint64 with zero
Change-Id: I5df140cf013d5836cb401c8a37cf5c367a7f31a0
GitHub-Last-Rev: 3d7cb7abb4
GitHub-Pull-Request: golang/go#78631
Reviewed-on: https://go-review.googlesource.com/c/go/+/765181
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
This commit is contained in:
parent
02d136966c
commit
9c0cb3c3a9
1 changed files with 3 additions and 2 deletions
|
|
@ -862,9 +862,10 @@ func (a *schedStatsAggregate) compute() {
|
|||
// include system goroutines in this count because we included
|
||||
// them above.
|
||||
a.gTotal = uint64(gcount(true))
|
||||
a.gWaiting = a.gTotal - (a.gRunning + a.gRunnable + a.gNonGo)
|
||||
if a.gWaiting < 0 {
|
||||
if a.gTotal < a.gRunning+a.gRunnable+a.gNonGo {
|
||||
a.gWaiting = 0
|
||||
} else {
|
||||
a.gWaiting = a.gTotal - (a.gRunning + a.gRunnable + a.gNonGo)
|
||||
}
|
||||
|
||||
unlock(&sched.lock)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue