Skip to content

Add emscripten_atomic_wait_suspending for ASYNCIFY/JSPI#26941

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:emscripten_atomic_wait_suspending
May 14, 2026
Merged

Add emscripten_atomic_wait_suspending for ASYNCIFY/JSPI#26941
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:emscripten_atomic_wait_suspending

Conversation

@sbc100
Copy link
Copy Markdown
Collaborator

@sbc100 sbc100 commented May 13, 2026

This works very much like the existing emscripten_atomic_wait_async but using ASYNCIFY/JSPI to suspend execution until the waitAsync operation is done.

@sbc100 sbc100 requested review from juj and tlively May 13, 2026 19:46
@sbc100 sbc100 force-pushed the emscripten_atomic_wait_suspending branch 2 times, most recently from 7258f6e to aa90c53 Compare May 13, 2026 19:57
@sbc100 sbc100 changed the title Add emscripten_atomic_wait_suspending for ASYNCIFY/JSPI Add emscripten_atomic_wait_suspending for ASYNCIFY/JSPI May 13, 2026
@sbc100 sbc100 requested review from brendandahl and dschuff May 13, 2026 20:01
@sbc100 sbc100 force-pushed the emscripten_atomic_wait_suspending branch 2 times, most recently from 0d3ee83 to d410445 Compare May 13, 2026 20:11
Comment thread system/include/emscripten/atomic.h Outdated
Comment thread src/lib/libatomic.js
@sbc100 sbc100 force-pushed the emscripten_atomic_wait_suspending branch 3 times, most recently from d9ff264 to 352fb30 Compare May 13, 2026 23:43
@sbc100
Copy link
Copy Markdown
Collaborator Author

sbc100 commented May 14, 2026

OK, after chatting online I agreed to make the sometimes-suspending version as a followup.

In fact its already here: bca3e2d

But I'd still like to land this first and then discussion that change separately if that's ok?

This works very much like the existing emscripten_atomic_wait_async
but using `ASYNCIFY`/`JSPI` to suspend execution until the `waitAsync`
operation is done.

The test here ends up depending on the internal
`_emscripten_thread_set_strongref` function unfortunately.
@sbc100 sbc100 force-pushed the emscripten_atomic_wait_suspending branch from 352fb30 to 1b1da4a Compare May 14, 2026 00:35
@sbc100 sbc100 enabled auto-merge (squash) May 14, 2026 01:11
@sbc100 sbc100 merged commit b2e19a3 into emscripten-core:main May 14, 2026
30 checks passed
@sbc100 sbc100 deleted the emscripten_atomic_wait_suspending branch May 14, 2026 01:40
sbc100 added a commit to sbc100/emscripten that referenced this pull request May 14, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request May 14, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request May 14, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request May 14, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request May 14, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request May 14, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request May 14, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request May 15, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request May 15, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants