mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 23:43:40 +00:00
runtime: remove the asyncScheduler constant
There is no reason to specialize this per chip as it is only ever used for JavaScript. Not only that, it is causing confusion and is yet another quirk to learn when porting the runtime to a new microcontroller.
This commit is contained in:
committed by
Ron Evans
parent
25b045d0a7
commit
8cd2a462b9
@@ -20,6 +20,10 @@ import (
|
||||
|
||||
const schedulerDebug = false
|
||||
|
||||
// On JavaScript, we can't do a blocking sleep. Instead we have to return and
|
||||
// queue a new scheduler invocation using setTimeout.
|
||||
const asyncScheduler = GOOS == "js"
|
||||
|
||||
var schedulerDone bool
|
||||
|
||||
// Queues used by the scheduler.
|
||||
@@ -138,6 +142,7 @@ func scheduler() {
|
||||
if t == nil {
|
||||
if sleepQueue == nil {
|
||||
if asyncScheduler {
|
||||
// JavaScript is treated specially, see below.
|
||||
return
|
||||
}
|
||||
waitForEvents()
|
||||
@@ -154,7 +159,8 @@ func scheduler() {
|
||||
if asyncScheduler {
|
||||
// The sleepTicks function above only sets a timeout at which
|
||||
// point the scheduler will be called again. It does not really
|
||||
// sleep.
|
||||
// sleep. So instead of sleeping, we return and expect to be
|
||||
// called again.
|
||||
break
|
||||
}
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user