mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-25 14:59:05 +00:00
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.
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user