mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
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:
committed by
Ron Evans
parent
c08b2dfe06
commit
e395c94e5f
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user