Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "sleep" forms of poll_oneoff. #2753

Merged
merged 3 commits into from
Mar 22, 2021

Conversation

sunfishcode
Copy link
Member

Add support for poll_oneoff calls which just sleep on a relative
timeout. This fixes a bug handling code compiled with WASI libc's sleep
family of functions, which call poll_oneoff with a CLOCK_REALTIME
timer, which wasn't previously implemented.

Add support for `poll_oneoff` calls which just sleep on a relative
timeout. This fixes a bug handling code compiled with WASI libc's `sleep`
family of functions, which call `poll_oneoff` with a `CLOCK_REALTIME`
timer, which wasn't previously implemented.
@sunfishcode sunfishcode requested a review from pchickey March 22, 2021 16:17
@github-actions github-actions bot added the wasi Issues pertaining to WASI label Mar 22, 2021
@github-actions
Copy link

Subscribe to Label Action

cc @kubkon

This issue or pull request has been labeled: "wasi"

Thus the following users have been cc'd because of the following labels:

  • kubkon: wasi

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

}
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This special case is a good idea, but i'd like for the thread::sleep call to instead be dispatched into self.sched.sleep so that wasi-common consumers can control that implementation by either using the default wasi-cap-std-sync impls or creating their own.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good; I've now added a sleep function to WasiSched and added impls for it.

@sunfishcode sunfishcode merged commit 2880dab into bytecodealliance:main Mar 22, 2021
@sunfishcode sunfishcode deleted the sunfishcode/sleep branch March 22, 2021 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasi Issues pertaining to WASI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants