Skip to content

Support "sleep" forms of poll_oneoff.#2753

Merged
sunfishcode merged 3 commits into
bytecodealliance:mainfrom
sunfishcode:sunfishcode/sleep
Mar 22, 2021
Merged

Support "sleep" forms of poll_oneoff.#2753
sunfishcode merged 3 commits into
bytecodealliance:mainfrom
sunfishcode:sunfishcode/sleep

Conversation

@sunfishcode
Copy link
Copy Markdown
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
Copy Markdown

Subscribe to Label Action

cc @kubkon

Details 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
Copy Markdown
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
Copy Markdown
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