Skip to content

Comments

Improve emscripten_futex_wait stub. NFC#26309

Open
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
sbc100:futex_wait_workers
Open

Improve emscripten_futex_wait stub. NFC#26309
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
sbc100:futex_wait_workers

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Feb 20, 2026

The test for wasm workers with emscripten_futex_wait was added in back in #21618 but AFAICT it was only even working when pthread support was also enabled.

Then pthread support is not enabled only the stub version is used which obviously doesn't work as expected.

I think it would be great to get this API working in pure wasm workers, but that is separate issue.

@sbc100 sbc100 requested review from cwoffenden, juj and kripken February 20, 2026 01:16
@sbc100 sbc100 force-pushed the futex_wait_workers branch 3 times, most recently from 7ce2891 to e36db36 Compare February 20, 2026 22:53
@sbc100
Copy link
Collaborator Author

sbc100 commented Feb 20, 2026

This was also causing some confusion in #26283

The test for wasm workers with `emscripten_futex_wait` was added in back
in emscripten-core#21618 but AFAICT it was only even working when pthread support was
also enabled.

However because the stub was simply returning 0 in all cases it was
enough to make it seems as if the API was working when it wasn't.

Indeed the `test/webaudio/audioworklet_worker.c` test seems to have
been written under the assumption that this API was available for use
in wasm workers.

It seems better to return ENOTSUP unless the API is actually available.
@sbc100 sbc100 force-pushed the futex_wait_workers branch from e36db36 to 1cd0d28 Compare February 21, 2026 00:03
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.

1 participant