Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lib/libatomic.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ addToLibrary({
// https://github.com/tc39/proposal-atomics-wait-async/blob/master/PROPOSAL.md
// This polyfill performs polling with setTimeout() to observe a change in the
// target memory location.
$polyfillWaitAsync__postset: `if (!Atomics.waitAsync || (globalThis.navigator?.userAgent && Number((navigator.userAgent.match(/Chrom(e|ium)\\/([0-9]+)\\./)||[])[2]) < 91)) {
$waitAsyncPolyfilled: '=(!Atomics.waitAsync || (globalThis.navigator?.userAgent && Number((navigator.userAgent.match(/Chrom(e|ium)\\/([0-9]+)\\./)||[])[2]) < 91));',
$polyfillWaitAsync__deps: ['$waitAsyncPolyfilled'],
$polyfillWaitAsync__postset: `if (waitAsyncPolyfilled) {
let __Atomics_waitAsyncAddresses = [/*[i32a, index, value, maxWaitMilliseconds, promiseResolve]*/];
function __Atomics_pollWaitAsyncAddresses() {
let now = performance.now();
Expand Down
4 changes: 2 additions & 2 deletions src/lib/libpthread.js
Original file line number Diff line number Diff line change
Expand Up @@ -1261,9 +1261,9 @@ var LibraryPThread = {
}
}),

_emscripten_thread_mailbox_await__deps: ['$checkMailbox'],
_emscripten_thread_mailbox_await__deps: ['$checkMailbox', '$waitAsyncPolyfilled'],
_emscripten_thread_mailbox_await: (pthread_ptr) => {
if (Atomics.waitAsync) {
if (!waitAsyncPolyfilled) {
// Wait on the pthread's initial self-pointer field because it is easy and
// safe to access from sending threads that need to notify the waiting
// thread.
Expand Down
Loading