Skip to content

Remove remaining pthread function from WASM_WORKERS build#26487

Merged
sbc100 merged 2 commits intoemscripten-core:mainfrom
sbc100:wasm_workers_no_pthreads
Mar 20, 2026
Merged

Remove remaining pthread function from WASM_WORKERS build#26487
sbc100 merged 2 commits intoemscripten-core:mainfrom
sbc100:wasm_workers_no_pthreads

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Mar 18, 2026

Remove remaining pthread function from WASM_WORKERS build. NFC

This includes pthread_self, along with the internal __get_tp function on which its bases.
These are not valid to call in Wasm Workers.

This PR is currently stacked on top of #26471

@sbc100 sbc100 force-pushed the wasm_workers_no_pthreads branch from 4cb407b to 80b40f3 Compare March 18, 2026 19:57
sbc100 added a commit to sbc100/emscripten that referenced this pull request Mar 18, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request Mar 18, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request Mar 18, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request Mar 18, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request Mar 18, 2026
@sbc100 sbc100 force-pushed the wasm_workers_no_pthreads branch from 80b40f3 to 1da8fe0 Compare March 18, 2026 23:30
sbc100 added a commit to sbc100/emscripten that referenced this pull request Mar 19, 2026
sbc100 added a commit that referenced this pull request Mar 20, 2026
@sbc100 sbc100 force-pushed the wasm_workers_no_pthreads branch 2 times, most recently from bf66e8b to 2b2c3fe Compare March 20, 2026 19:54
sbc100 added a commit to sbc100/emscripten that referenced this pull request Mar 20, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request Mar 20, 2026
sbc100 added a commit that referenced this pull request Mar 20, 2026
…n_futex_wait`. NFC (#26471)

This reduces the number of places we need to breaking up our `wait`
operation. It also means that other users the `emscripten_futex_wait`
API don't break pthread proxying or async cancellation.

This change removes one more place where we were erroneously calling
`pthread_self()` in the Wasm Workers build of libc, so this change also
makes the code less broken in the Wasm Worker case.

Needed as part of #26487
@sbc100 sbc100 force-pushed the wasm_workers_no_pthreads branch from 2b2c3fe to c92de04 Compare March 20, 2026 21:31
This includes `pthread_self`, which is not valid to call in Wasm
Workers.
@sbc100 sbc100 force-pushed the wasm_workers_no_pthreads branch from c92de04 to 9034992 Compare March 20, 2026 21:31
@sbc100 sbc100 requested review from dschuff and kripken March 20, 2026 21:31
sbc100 added a commit that referenced this pull request Mar 20, 2026
…#26508)

Specifically, this avoids referencing `pthead_self` is Wasm Workers
builds.

Split out from #26487
@sbc100
Copy link
Collaborator Author

sbc100 commented Mar 20, 2026

Actually instead of this I think we can just make them work now! #26510

@sbc100
Copy link
Collaborator Author

sbc100 commented Mar 20, 2026

Actually I'm going to land this now and we can work on making the pthread API work in Wasm Workers as a followup.

@sbc100 sbc100 merged commit fce11ef into emscripten-core:main Mar 20, 2026
38 checks passed
@sbc100 sbc100 deleted the wasm_workers_no_pthreads branch March 20, 2026 22:38
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