When Atomics.wait() is polyfilled, do not attempt to use it in _emscripten_thread_mailbox_await()#25853
Merged
juj merged 3 commits intoemscripten-core:mainfrom Nov 26, 2025
Merged
Conversation
…ipten_thread_mailbox_await(), since the polyfill will not work there. This is take two at fixing emscripten-core#25494.
sbc100
reviewed
Nov 22, 2025
src/lib/libpthread.js
Outdated
| _emscripten_thread_mailbox_await__deps: ['$checkMailbox', '$waitAsyncPolyfilled'], | ||
| _emscripten_thread_mailbox_await: (pthread_ptr) => { | ||
| if (Atomics.waitAsync) { | ||
| if (!Atomics.waitAsyncPolyfilled) { |
Collaborator
There was a problem hiding this comment.
Why not just if (waitAsyncPolyfilled)? i.e. why modify the Atomics object at all?
Collaborator
Author
There was a problem hiding this comment.
The idea was to make it look like a public API, if other code might need to check if the implementation was polyfilled or not. Changed to not modify the Atomics object.
sbc100
reviewed
Nov 22, 2025
9df5170 to
ab34b32
Compare
Collaborator
|
I assume there reason there is no test here is because writing a tests very hard? |
sbc100
approved these changes
Nov 22, 2025
Collaborator
Author
There is an existing test that is flaky due to this - |
inolen
pushed a commit
to inolen/emscripten
that referenced
this pull request
Feb 13, 2026
…ipten_thread_mailbox_await() (emscripten-core#25853) When Atomics.wait() is polyfilled, do not attempt to use it in _emscripten_thread_mailbox_await(), since the polyfill will not work there. This is take two at fixing emscripten-core#25494.
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.
When Atomics.wait() is polyfilled, do not attempt to use it in _emscripten_thread_mailbox_await(), since the polyfill will not work there. This is take two at fixing #25494.