mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 11:13:27 +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()
|
task.PauseLocked()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NumCPU returns the number of CPU cores on this system.
|
||||||
|
func NumCPU() int {
|
||||||
|
return numCPU
|
||||||
|
}
|
||||||
|
|
||||||
func addTimer(tn *timerNode) {
|
func addTimer(tn *timerNode) {
|
||||||
schedulerLock.Lock()
|
schedulerLock.Lock()
|
||||||
timerQueueAdd(tn)
|
timerQueueAdd(tn)
|
||||||
|
|||||||
Reference in New Issue
Block a user