3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-08 15:13:23 +00:00

Update emscripten (#7473)

* fixes for newer emscripten thread handling behavior

* fix return type for async wrapper functions

* update prettier

* update typescript and fix errors

* update emscripten version in CI

* update js readme about tests
This commit is contained in:
Kevin Gibbons 2024-12-06 18:11:14 -08:00 committed by GitHub
parent 4fbf54afd0
commit e5f8327483
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 275 additions and 108 deletions

View file

@ -58,8 +58,24 @@ void wrapper(Args&&... args) {
reject_async('failed with unknown exception');
});
}
MAIN_THREAD_ASYNC_EM_ASM({
// this clears the earliest timeout
// not necessarily the one corresponding to this thread
// but that's ok
clearTimeout(threadTimeouts.shift());
});
});
t.detach();
EM_ASM({
// https://github.com/emscripten-core/emscripten/issues/23092
// in Node.js, the process will die if there is no active work
// which can happen while the thread is spawning
// or while it is running
// so we set a timeout here so it stays alive
// this needs to be longer than it could conceivably take to call the one function
// it gets cleared as soon as the thread actually finishes
threadTimeouts.push(setTimeout(() => {}, 600000));
});
}
template<typename Fn, Fn fn, typename... Args>
@ -79,8 +95,24 @@ void wrapper_str(Args&&... args) {
reject_async(new Error('failed with unknown exception'));
});
}
MAIN_THREAD_ASYNC_EM_ASM({
// this clears the earliest timeout
// not necessarily the one corresponding to this thread
// but that's ok
clearTimeout(threadTimeouts.shift());
});
});
t.detach();
EM_ASM({
// https://github.com/emscripten-core/emscripten/issues/23092
// in Node.js, the process will die if there is no active work
// which can happen while the thread is spawning
// or while it is running
// so we set a timeout here so it stays alive
// this needs to be longer than it could conceivably take to call the one function
// it gets cleared as soon as the thread actually finishes
threadTimeouts.push(setTimeout(() => {}, 600000));
});
}