My problem is probably related. I also port a library within I use emscripten_sleep() commands to avoid that applications using this library have to change their event loop to emscripten_set_main_loop(). Up to now I thought my problems would be related to the following thread since it also mentions the -12 error code:
https://groups.google.com/forum/#!searchin/emscripten-discuss/emscripten_sleep_with_yield/emscripten-discuss/dR5KtlyXyHQ/CI9BjTXesGgJIs there any documentation anywhere what these error codes mean? I now changed my program and sometimes get "27". I already had "-1" and "-12" in the past. If have no clue what this means.
Since there seems to be no quick solution at the moment, I plan to change my project to use emscripten_set_main_loop() instead.
Now that I already put these emscripten_sleep() commands into my library and want to change to emscripten_set_main_loop() to get something working I have the following questions:
- can I leave the emscripten_sleep() commands in the library even when it is used with a program using emscripten_set_main_loop() or do I need to take them out? This way the library could be used with and without EMTERPRETIFY=1 / EMTERPRETIFY_ASYNC=1 setting by an application program. Does the emscripten_sleep() command have any effect when using emscripten_set_main_loop()? I thought it gives a time-slice to the browser.
- when compiling the files for the library and combining them with EMAR, do I need to use EMTERPRETIFY=1 / EMTERPRETIFY_ASYNC=1 when the library shall be used with an application that will use EMTERPRETIFY=1 / EMTERPRETIFY_ASYNC=1? And compile the library again without EMTERPRETIFY=1 / EMTERPRETIFY_ASYNC=1 if it shall be used with an application using emscripten_set_main_loop()?
George