Fixes #70661
Change-Id: I58a465cfb1cd16709ffbb072eca0997569540074
Reviewed-on: https://go-review.googlesource.com/c/go/+/633281
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
func synctestidle_c(gp *g, _ unsafe.Pointer) bool {
lock(&gp.syncGroup.mu)
- defer unlock(&gp.syncGroup.mu)
+ canIdle := true
if gp.syncGroup.running == 0 && gp.syncGroup.active == 1 {
// All goroutines in the group have blocked or exited.
- return false
+ canIdle = false
+ } else {
+ gp.syncGroup.active--
}
- gp.syncGroup.active--
- return true
+ unlock(&gp.syncGroup.mu)
+ return canIdle
}
//go:linkname synctestWait internal/synctest.Wait