runtime: implement NumCPU for the multicore scheduler

I forgot to add it in the first PR, here:
https://github.com/tinygo-org/tinygo/pull/4851
This commit is contained in:
Ayke van Laethem
2025-06-12 12:01:48 +02:00
committed by Ron Evans
parent c08b2dfe06
commit e395c94e5f
+5
View File
@@ -87,6 +87,11 @@ func Gosched() {
task.PauseLocked()
}
// NumCPU returns the number of CPU cores on this system.
func NumCPU() int {
return numCPU
}
func addTimer(tn *timerNode) {
schedulerLock.Lock()
timerQueueAdd(tn)