mirror of
https://github.com/golang/go
synced 2024-11-23 16:40:03 -07:00
runtime: document that NumCPU does not change
Fixes #11609. Change-Id: I3cf64164fde28ebf739706728b84d8ef5b6dc90e Reviewed-on: https://go-review.googlesource.com/17456 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
025e9b0ca3
commit
c5a94ba24f
@ -35,6 +35,10 @@ func GOMAXPROCS(n int) int {
|
||||
}
|
||||
|
||||
// NumCPU returns the number of logical CPUs usable by the current process.
|
||||
//
|
||||
// The set of available CPUs is checked by querying the operating system
|
||||
// at process startup. Changes to operating system CPU allocation after
|
||||
// process startup are not reflected.
|
||||
func NumCPU() int {
|
||||
return int(ncpu)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user