Skip to content

Implement sem_timedwait - #80

Open
pnewell wants to merge 2 commits into
wasix-org:mainfrom
pnewell:fix-futex-wait
Open

Implement sem_timedwait#80
pnewell wants to merge 2 commits into
wasix-org:mainfrom
pnewell:fix-futex-wait

Conversation

@pnewell

@pnewell pnewell commented Aug 11, 2025

Copy link
Copy Markdown

sem_timedwait relies on __timedwait_cp which is currently using a fallback that ignores the passed in value.

This branch:

  • removes that fallback as it should no longer be necessary
  • fixes a bug in __wasilibc_futex_wait_wasix that was not properly setting the timeout when there was a value of 0 or greater

- Include 0 in some so behavior matches other platforms
- Set timeout value to u.some when value is 0 or greater
- __futex4_cp is implemented and __wasilibc_futex_wait_wasix is now working properly, so removing fallback infinite wait
@Arshia001
Arshia001 self-requested a review August 12, 2025 11:37
@Arshia001

Copy link
Copy Markdown

Hey @pnewell, thanks for this contribution!

Can you please share a code snippet that was broken before this change, but now works correctly?

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