Skip to content

Fix timeout in emscripten_semaphore_wait_acquire#26458

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

Fix timeout in emscripten_semaphore_wait_acquire#26458
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
sbc100:fix_emscripten_semaphore

Conversation

@sbc100
Copy link
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 2 times, most recently from 932d9dd to d7df884 Compare March 14, 2026 01:19
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 d7df884 to a14cbf7 Compare March 14, 2026 01:27
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