Minor cleanup of setitimer. NFC#26655
Merged
Merged
Conversation
3398df7 to
f580800
Compare
These minor cleanups were split out from my larger work on precise wakeups.
f580800 to
b119d4c
Compare
kripken
approved these changes
Apr 9, 2026
This was referenced Apr 22, 2026
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Apr 22, 2026
Timers are only ever run on them main runtime thread. In emscripten-core#26655 I added an assertion to ensure that `_emscripten_check_timers` is only called from the main runtime thread. This broke tests such as `lto0.test_wasm_worker_futex_wait`. The reason this test only failed in the LTO build on not under core0 is due to a bug in LTO which defeats the weak alias mechanism that is designed to only pull in the timer code when needed: ``` weak_alias(dummy, _emscripten_check_timers); ``` This changes fixes the stub version of `emscripten_yield_stub` so that it avoids calling `_emscripten_check_timers` from Wasm Workers. Note: In a Wasm Workers build one can register and use timers from the main thread, but one cannot register a timer from a Wasm Worker (because _setitimer_js is a proxied func).
sbc100
added a commit
that referenced
this pull request
Apr 22, 2026
Timers are only ever run on them main runtime thread. In #26655 I added an assertion to ensure that `_emscripten_check_timers` is only called from the main runtime thread. This broke tests such as `lto0.test_wasm_worker_futex_wait`. The reason this test only failed in the LTO build on not under core0 is due to a bug in LTO which defeats the weak alias mechanism that is designed to only pull in the timer code when needed: ``` weak_alias(dummy, _emscripten_check_timers); ``` This changes fixes the stub version of `emscripten_yield_stub` so that it avoids calling `_emscripten_check_timers` from Wasm Workers. Note: In a Wasm Workers build one can register and use timers from the main thread, but one cannot register a timer from a Wasm Worker (because _setitimer_js is a proxied func).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These minor cleanups were split out from my larger work on precise wakeups.