Move emscripten_wasm_worker_self_id to native code. NFC#26468
Merged
sbc100 merged 1 commit intoemscripten-core:mainfrom Mar 17, 2026
Merged
Move emscripten_wasm_worker_self_id to native code. NFC#26468sbc100 merged 1 commit intoemscripten-core:mainfrom
emscripten_wasm_worker_self_id to native code. NFC#26468sbc100 merged 1 commit intoemscripten-core:mainfrom
Conversation
a39cb00 to
ed753e8
Compare
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Mar 17, 2026
This change doesn't look very useful but as followup to this (and combined with emscripten-core#26468) this should allow us to enable more internal musl locking code that currently depends on `pthread_self()->tid`.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Mar 17, 2026
This change doesn't look very useful but as followup to this (and combined with emscripten-core#26468) this should allow us to enable more internal musl locking code that currently depends on `pthread_self()->tid`.
ed753e8 to
1a4e775
Compare
1a4e775 to
0a51da3
Compare
This will speed up this function significantly which is going to be important for hybrid pthreads + Wasm Workers builds where we need to be able to distinguish between Wasm Workers and non-Wasm Workers sometimes at the very local level. Note that this function returns 0 for all non-Wasm Workers, which includes both the main thread and pthreads. Also, move emscripten_current_thread_is_wasm_worker since that is trivially implemented on top of `_self_id()`
0a51da3 to
e3d078c
Compare
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Mar 17, 2026
This change doesn't look very useful but as followup to this (and combined with emscripten-core#26468) this should allow us to enable more internal musl locking code that currently depends on `pthread_self()->tid`.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Mar 17, 2026
This change doesn't look very useful but as followup to this (and combined with emscripten-core#26468) this should allow us to enable more internal musl locking code that currently depends on `pthread_self()->tid`.
dschuff
approved these changes
Mar 17, 2026
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Mar 17, 2026
This change doesn't look very useful but as followup to this (and combined with emscripten-core#26468) this should allow us to enable more internal musl locking code that currently depends on `pthread_self()->tid`.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Mar 17, 2026
This change doesn't look very useful but as followup to this (and combined with emscripten-core#26468) this should allow us to enable more internal musl locking code that currently depends on `pthread_self()->tid`.
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Mar 17, 2026
This change doesn't look very useful but as followup to this (and combined with emscripten-core#26468) this should allow us to enable more internal musl locking code that currently depends on `pthread_self()->tid`.
sbc100
added a commit
that referenced
this pull request
Mar 18, 2026
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.
This will speed up this function significantly which is going to be important for hybrid pthreads + Wasm Workers builds where we need to be able to distinguish between Wasm Workers and non-Wasm Workers sometimes at the very local level.
Note that this function returns 0 for all non-Wasm Workers, which includes both the main thread and pthreads.
Also, move emscripten_current_thread_is_wasm_worker since that is trivially implemented on top of
_self_id()