src/runtime: add stub for runtime.NumCPU()

This adds a stub for the `NumCPU()` function from the `runtime`
package.
This change allows code to compile that tries to access this function.

I guess for most hardware boards and WASM setting this value to `1` is
fine. And as far as I can see it shouldn't break or change existing
applications, because the function previously did not exist at all.
Этот коммит содержится в:
ZauberNerd 2022-03-04 15:21:55 +00:00 коммит произвёл Ron Evans
родитель 1472fb6032
коммит 1fac41d535

10
src/runtime/debug.go Обычный файл
Просмотреть файл

@ -0,0 +1,10 @@
package runtime
// 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 1
}