Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jan 12, 2026

Without this, its up to each callsite to inject callUserCallback (e.g. via safeSetTimeout vs setTimeout).

Forgetting to do so can resulting in strange behaviour such as exit() not work as expected when called from the continuation.

@sbc100 sbc100 force-pushed the asyncify_callUserCallback branch 2 times, most recently from b559688 to 6122ec5 Compare January 13, 2026 01:10
@sbc100 sbc100 requested a review from brendandahl January 13, 2026 01:10
@sbc100 sbc100 force-pushed the asyncify_callUserCallback branch from 6122ec5 to ee1f567 Compare January 13, 2026 01:12
@sbc100 sbc100 requested a review from kripken January 13, 2026 01:12
@sbc100
Copy link
Collaborator Author

sbc100 commented Jan 13, 2026

This change is going to be useful / essential for the followup to #26019 where i hope to make all (most) asyncify usage in the JS library automatic/transparent.

@sbc100 sbc100 force-pushed the asyncify_callUserCallback branch from ee1f567 to 20d5e0b Compare January 13, 2026 17:41
@sbc100 sbc100 force-pushed the asyncify_callUserCallback branch 2 times, most recently from 257a6ad to d354cfd Compare January 13, 2026 23:44
@sbc100 sbc100 force-pushed the asyncify_callUserCallback branch from d354cfd to f157cef Compare January 14, 2026 17:53
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

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

lgtm % comment

@sbc100 sbc100 force-pushed the asyncify_callUserCallback branch from f157cef to fc6f5e6 Compare January 14, 2026 21:46
@sbc100 sbc100 force-pushed the asyncify_callUserCallback branch from fc6f5e6 to 02d48dd Compare January 14, 2026 22:39
@sbc100 sbc100 merged commit 0af441e into emscripten-core:main Jan 14, 2026
35 checks passed
@sbc100 sbc100 deleted the asyncify_callUserCallback branch January 14, 2026 23:42
sbc100 added a commit that referenced this pull request Jan 15, 2026
Followup to #26019 and #26095.

The old comment here is, I believe, no longer valid now that #26095 has
landed.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Jan 15, 2026
The only function that remains that still uses `async: true` is
`emscripten_fiber_swap`, and this is because it doesn't use handleSleep
or handleAsync, so is not a candidate for `async: auto`.

Followup to emscripten-core#26019 and emscripten-core#26095.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Jan 15, 2026
The only function that remains that still uses `async: true` is
`emscripten_fiber_swap`, and this is because it doesn't use handleSleep
or handleAsync, so is not a candidate for `async: auto`.

Followup to emscripten-core#26019 and emscripten-core#26095.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Jan 15, 2026
The only function that remains that still uses `async: true` is
`emscripten_fiber_swap`, and this is because it doesn't use handleSleep
or handleAsync, so is not a candidate for `async: auto`.

Followup to emscripten-core#26019 and emscripten-core#26095.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Jan 15, 2026
The only function that remains that still uses `async: true` is
`emscripten_fiber_swap`, and this is because it doesn't use handleSleep
or handleAsync, so is not a candidate for `async: auto`.

Followup to emscripten-core#26019 and emscripten-core#26095.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Jan 15, 2026
The only function that remains that still uses `async: true` is
`emscripten_fiber_swap`, and this is because it doesn't use handleSleep
or handleAsync, so is not a candidate for `async: auto`.

Followup to emscripten-core#26019 and emscripten-core#26095.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Jan 16, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request Jan 16, 2026
This test throws exceptions from withing native code which causes the
runtime to exit as the stack is unwound.
sbc100 added a commit that referenced this pull request Jan 16, 2026
This test throws exceptions from withing native code which causes the
runtime to exit as the stack is unwound.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Jan 16, 2026
The only function that remains that still uses `async: true` is
`emscripten_fiber_swap`, and this is because it doesn't use handleSleep
or handleAsync, so is not a candidate for `async: auto`.

Followup to emscripten-core#26019 and emscripten-core#26095.
sbc100 added a commit that referenced this pull request Jan 17, 2026
The only function that remains that still uses `async: true` is
`emscripten_fiber_swap`, and this is because it doesn't use handleSleep
or handleAsync, so is not a candidate for `async: auto`.

Followup to #26019 and #26095.
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