Skip to content

Enable gettid() under WASM_WORKERS#26472

Merged
sbc100 merged 2 commits intoemscripten-core:mainfrom
sbc100:wasm_worker_gettid
Mar 18, 2026
Merged

Enable gettid() under WASM_WORKERS#26472
sbc100 merged 2 commits intoemscripten-core:mainfrom
sbc100:wasm_worker_gettid

Conversation

@sbc100
Copy link
Copy Markdown
Collaborator

@sbc100 sbc100 commented Mar 17, 2026

This change doesn't look very useful but as followup to this (and combined with #26468) this should allow us to enable more internal musl locking code that currently depends on pthread_self()->tid.

@sbc100 sbc100 requested review from dschuff and kripken March 17, 2026 20:27
@sbc100 sbc100 force-pushed the wasm_worker_gettid branch from 276be6c to c4c8966 Compare March 17, 2026 20:28
@sbc100 sbc100 changed the title Enable gettid() under WASM_WORKERS Enable gettid() under WASM_WORKERS Mar 17, 2026
@sbc100 sbc100 force-pushed the wasm_worker_gettid branch 2 times, most recently from eba7750 to 1a4199a Compare March 17, 2026 21:49
@sbc100 sbc100 requested a review from kripken March 17, 2026 21:51
Copy link
Copy Markdown
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 otherwise

@sbc100 sbc100 force-pushed the wasm_worker_gettid branch 2 times, most recently from 47145ef to 6e63248 Compare March 17, 2026 23:32
@sbc100
Copy link
Copy Markdown
Collaborator Author

sbc100 commented Mar 17, 2026

This is now rebased on top of #26472 , please review just the second commit.

@kripken
Copy link
Copy Markdown
Member

kripken commented Mar 17, 2026

Second commit lgtm

@kripken
Copy link
Copy Markdown
Member

kripken commented Mar 17, 2026

This is now rebased on top of #26472

That is this PR, I think you mean #26474?

sbc100 added 2 commits March 17, 2026 16:49
…f other MTLibrary libs). NFC

This library gets linking into `-pthreads` build where wasm worker APIs
are not available.

If we have code in libc that looks like this it would fail to link in
that case:

```
use_wasm_worker_api();
```

The fact that this has worked thus far is only because we don't use that
macro anywhere in libc today.
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 sbc100 force-pushed the wasm_worker_gettid branch from 6e63248 to 0cf0a3f Compare March 17, 2026 23:50
@sbc100 sbc100 merged commit 3f6a380 into emscripten-core:main Mar 18, 2026
38 checks passed
@sbc100 sbc100 deleted the wasm_worker_gettid branch March 18, 2026 02:52
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