diff options
-rw-r--r-- | src/runtime/proc.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go index d1f5088b50..47ccb37c9f 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -443,6 +443,9 @@ func schedinit() { sched.lastpoll = uint64(nanotime()) procs := int(ncpu) + if procs > _MaxGomaxprocs { + procs = _MaxGomaxprocs + } if n := atoi(gogetenv("GOMAXPROCS")); n > 0 { if n > _MaxGomaxprocs { n = _MaxGomaxprocs |