From eb48bfbbdaf3a99dbb861f251a73a3b6ae45cc8b Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Thu, 6 May 2010 11:50:47 -0700 Subject: runtime.GOMAXPROCS: hack it to have it return the old value. R=rsc CC=golang-dev https://golang.org/cl/1140041 --- src/pkg/runtime/extern.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/pkg/runtime/extern.go') diff --git a/src/pkg/runtime/extern.go b/src/pkg/runtime/extern.go index 1e284e8d71..72b43ae9bd 100644 --- a/src/pkg/runtime/extern.go +++ b/src/pkg/runtime/extern.go @@ -106,8 +106,10 @@ func LockOSThread() func UnlockOSThread() // GOMAXPROCS sets the maximum number of CPUs that can be executing -// simultaneously. This call will go away when the scheduler improves. -func GOMAXPROCS(n int) +// simultaneously and returns the previous setting. If n < 1, it does not +// change the current setting. +// This call will go away when the scheduler improves. +func GOMAXPROCS(n int) int // Cgocalls returns the number of cgo calls made by the current process. func Cgocalls() int64 -- cgit v1.3-5-g9baa