Skip to content

Fix timeout in emscripten_semaphore_wait_acquire#26458

Merged
sbc100 merged 1 commit intoemscripten-core:mainfrom
sbc100:fix_emscripten_semaphore
Mar 18, 2026
Merged

Fix timeout in emscripten_semaphore_wait_acquire#26458
sbc100 merged 1 commit intoemscripten-core:mainfrom
sbc100:fix_emscripten_semaphore

Conversation

@sbc100
Copy link
Copy Markdown
Collaborator

@sbc100 sbc100 commented Mar 14, 2026

This fixes the TODO in this function which meant that the timeout was not correctly honored in the case of multiple wakeups.

The code here is basically the same as the existing code in emscripten_lock_wait_acquire just above.

I also added a new test for emscripten_lock_wait_acquire even though the test doesn't specifically test for the TODO issue being addresses in this change (that would require a more complex test that involves generating spurious wakeups).

@sbc100 sbc100 requested review from dschuff, juj and kripken March 14, 2026 00:51
@sbc100 sbc100 force-pushed the fix_emscripten_semaphore branch 3 times, most recently from d7df884 to a14cbf7 Compare March 14, 2026 01:27
@sbc100 sbc100 force-pushed the fix_emscripten_semaphore branch from a14cbf7 to 3e2d021 Compare March 16, 2026 23:20
This fixes the TODO in this function which meant that the timeout
was not correctly honored in the case of multiple wakeups.

The code here is basically the same as the existing code in
`emscripten_lock_wait_acquire` just above.
@sbc100 sbc100 force-pushed the fix_emscripten_semaphore branch from 3e2d021 to b47e8b5 Compare March 16, 2026 23:21
@sbc100 sbc100 merged commit 2d963b9 into emscripten-core:main Mar 18, 2026
37 of 38 checks passed
@sbc100 sbc100 deleted the fix_emscripten_semaphore branch March 18, 2026 02:41
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