Skip to content

Allow emscripten_atomic_wait_suspending to return synchronously#26947

Open
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:emscripten_atomic_wait_suspending2
Open

Allow emscripten_atomic_wait_suspending to return synchronously#26947
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:emscripten_atomic_wait_suspending2

Conversation

@sbc100
Copy link
Copy Markdown
Collaborator

@sbc100 sbc100 commented May 14, 2026

Followup to the initial version landed in #26941. This version of the code allows for reporting of synchronous results without actually suspending.

@sbc100 sbc100 requested a review from tlively May 14, 2026 03:44
em_settled_result_t result = emscripten_promise_await(promise);
if (result.result != EM_PROMISE_FULFILL) {
__builtin_abort();
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some way to avoid writing these three lines? i.e. should we have a version if emscripten_promise_await that lets rejected promises propogate to the top level instead of handling them ourselves?

@sbc100 sbc100 force-pushed the emscripten_atomic_wait_suspending2 branch 2 times, most recently from aece5ac to 3f54471 Compare May 14, 2026 15:37
Comment thread src/lib/libatomic.js Outdated
@sbc100 sbc100 force-pushed the emscripten_atomic_wait_suspending2 branch 2 times, most recently from 39b92c5 to 2ad602d Compare May 14, 2026 16:36
@sbc100 sbc100 force-pushed the emscripten_atomic_wait_suspending2 branch from 2ad602d to f2b3b85 Compare May 14, 2026 16:36
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.

1 participant