2. Even though it works, I don't like fact that I am checking
emulation period in c++, I want to do in this way:
while (1) {
syncSleep();
PIC_RunQueue();
}
//...
EM_JS(void, syncSleep, (), {
if (Date.now() - Module.last_sync_time <= 16) {
return;
}
return Asyncify.handleSleep(function(wakeUp) {
// post/recive impl
});
});
BUT, looks like it's not possible to not call Asyncify.handleSleep in
ASYNCIFY_IMPORT function. If I return 0/undfeinied from it execution
always terminate with message "Unreachable executed...". Is there are
any workaround for this?
3. Can you explain how asyncify handle recursion. Looks it not valid
case for asyncify. DOSBOX can run emulation loop inside emulation
loop, like this:
void loop() {
while(1) {
syncSleep();
// <...>
printf("int21 handler\n");
loop();
}
}
For this case browser hangs. I added console.log into syncSleep
function, and typical log is:
syncSleep (1593)
int21 handler called
// no any syncSleep anymore
I think maybe in case of recursion call stack is overwritten or
something similar, what do you think?
Cause I don't understand why log stops.
--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAKOm%3DVFaCX1Y--QjVP1Rxqs3TTf7ETZ-%2B%3DmHqZ_UyRDVbkqJ6g%40mail.gmail.com.