aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library_browser.js2
-rw-r--r--system/include/emscripten/emscripten.h6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/library_browser.js b/src/library_browser.js
index 4c26037e..f12e966e 100644
--- a/src/library_browser.js
+++ b/src/library_browser.js
@@ -223,7 +223,7 @@ mergeInto(LibraryManager.library, {
var wrapper = function() {
if (Browser.mainLoop.queue.length > 0) {
Browser.mainLoop.queue.shift()();
- Browser.mainLoop.scheduler();
+ setTimeout(wrapper, 0);
return;
}
if (Browser.mainLoop.shouldPause) {
diff --git a/system/include/emscripten/emscripten.h b/system/include/emscripten/emscripten.h
index 575c3e2a..9bc6c410 100644
--- a/system/include/emscripten/emscripten.h
+++ b/system/include/emscripten/emscripten.h
@@ -52,7 +52,13 @@ extern void emscripten_cancel_main_loop();
* Add a function to a queue of events that will execute
* before the main loop will continue.
*/
+#if EMSCRIPTEN
extern void emscripten_push_main_loop_blocker(void (*func)());
+#else
+inline void emscripten_push_main_loop_blocker(void (*func)()) {
+ func();
+}
+#endif
/*
* Call a C function asynchronously, that is, after returning