diff --git a/src/cmd/api/goapi.go b/src/cmd/api/goapi.go index 036aefe4d8..5ae059e4ce 100644 --- a/src/cmd/api/goapi.go +++ b/src/cmd/api/goapi.go @@ -459,8 +459,11 @@ type listImports struct { var listCache sync.Map // map[string]listImports, keyed by contextName -// listSem is a semaphore restricting concurrent invocations of 'go list'. -var listSem = make(chan semToken, ((runtime.GOMAXPROCS(0)-1)/2)+1) +// listSem is a semaphore restricting concurrent invocations of 'go list'. 'go +// list' has its own internal concurrency, so we use a hard-coded constant (to +// allow the I/O-intensive phases of 'go list' to overlap) instead of scaling +// all the way up to GOMAXPROCS. +var listSem = make(chan semToken, 2) type semToken struct{}