runtime: default GOMAXPROCS to NumCPU(), not 1

See golang.org/s/go15gomaxprocs for details.

Change-Id: I8de5df34fa01d31d78f0194ec78a2474c281243c
Reviewed-on: https://go-review.googlesource.com/10668
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Russ Cox 2015-05-28 12:35:35 -04:00
parent 14da5bef5f
commit 3ffcbb633e

View file

@ -62,7 +62,7 @@ func schedinit() {
gcinit()
sched.lastpoll = uint64(nanotime())
procs := 1
procs := int(ncpu)
if n := atoi(gogetenv("GOMAXPROCS")); n > 0 {
if n > _MaxGomaxprocs {
n = _MaxGomaxprocs