Skip to content

Move low level lock/condvar/semaphore form libwasm_worker to libc. - #26433

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:wasm_worker_locks
Mar 11, 2026
Merged

sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:wasm_worker_locks

Conversation

@sbc100

@sbc100 sbc100 commented Mar 11, 2026 •

Copy link
Copy Markdown
Collaborator

I've moved the declarations of these functions to a new header (threading_primitives.h) which is then included in both wasm_workers.h and in threading.h.

Add a some basic testing that these function are available under pthreads as well as wasm workers.

This is step towards using these primitives to make implement libc++'s mutex/cond helpers needed for call_once. See #26375.

All the declaration and implementations here are unchanged: This is a pure move.

@sbc100 sbc100 changed the title Move low level lock/condvar/semaphore form libwasm_work to libc. Move low level lock/condvar/semaphore form libwasm_worker to libc. Mar 11, 2026
@sbc100
sbc100 requested review from dschuff, juj and kripken March 11, 2026 16:23
@sbc100
sbc100 force-pushed the wasm_worker_locks branch 2 times, most recently from cf5bb23 to 4ffbf0f Compare March 11, 2026 18:39
I've moved the declarations of these functions to a new header
(`threading_primitives.h`) which is then included in both
`wasm_workers.h` and in `threading.h`.

Add a some basic testing that these function are available under
pthreads as well as wasm workers.
@sbc100
sbc100 force-pushed the wasm_worker_locks branch from 4ffbf0f to 4ef711e Compare March 11, 2026 18:45
@sbc100

sbc100 commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator Author

Also TIL one can confirm the moved code is unmodified using git show --color-moved (works with git diff too).

@sbc100
sbc100 enabled auto-merge (squash) March 11, 2026 22:00
@sbc100
sbc100 merged commit cc9fb50 into emscripten-core:main Mar 11, 2026
3 checks passed
@sbc100
sbc100 deleted the wasm_worker_locks branch March 11, 2026 22:18
sbc100 added a commit to sbc100/emscripten that referenced this pull request Mar 11, 2026
sbc100 added a commit to sbc100/emscripten that referenced this pull request Mar 12, 2026
sbc100 added a commit that referenced this pull request Mar 12, 2026
@dschuff

dschuff commented Mar 12, 2026

Copy link
Copy Markdown
Member

sbc100 added a commit to sbc100/emscripten that referenced this pull request Mar 12, 2026
sbc100 added a commit that referenced this pull request Mar 12, 2026
`WASM_WORKERS` is not currently compatible with ASAN.

See #26433
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.

3 participants