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:
Ayke van Laethem
2024-10-30 12:12:10 +01:00
committed by Ayke
parent 8ff97bdedd
commit 04a7baec3e
4 changed files with 20 additions and 26 deletions
+2 -2
View File
@@ -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 {