void WakeupScheduler() { if (!scheduled_zero) { WasmRuntime.ScheduleTimeout(0, this.RunScheduler); scheduled_zero = true; } }
void RunScheduler() { scheduled_zero = false; int ms_wait = RunSchedulerLoop(cached_new_time); if (ms_wait >= 0) { WasmRuntime.ScheduleTimeout(ms_wait, this.RunScheduler); if (ms_wait == 0) { scheduled_zero = true; } } }