mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 23:13:40 +00:00
wasm: support //go:wasmexport functions after a call to time.Sleep
This fixes a bug where `//go:wasmexport` functions would not be allowed anymore after a call to `time.Sleep` (when using `-buildmode=default`).
This commit is contained in:
@@ -21,7 +21,7 @@ const schedulerDebug = false
|
||||
// queue a new scheduler invocation using setTimeout.
|
||||
const asyncScheduler = GOOS == "js"
|
||||
|
||||
var schedulerDone bool
|
||||
var mainExited bool
|
||||
|
||||
// Queues used by the scheduler.
|
||||
var (
|
||||
@@ -166,7 +166,7 @@ func removeTimer(tim *timer) bool {
|
||||
func scheduler(returnAtDeadlock bool) {
|
||||
// Main scheduler loop.
|
||||
var now timeUnit
|
||||
for !schedulerDone {
|
||||
for !mainExited {
|
||||
scheduleLog("")
|
||||
scheduleLog(" schedule")
|
||||
if sleepQueue != nil || timerQueue != nil {
|
||||
|
||||
Reference in New Issue
Block a user