Add a sleep function to the WasiSched trait.

This commit is contained in:
Dan Gohman
2021-03-22 11:23:45 -07:00
parent dd7e16762c
commit 2880dab8f8
5 changed files with 32 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ use subscription::{MonotonicClockSubscription, RwSubscription, Subscription, Sub
pub trait WasiSched {
fn poll_oneoff(&self, poll: &Poll) -> Result<(), Error>;
fn sched_yield(&self) -> Result<(), Error>;
fn sleep(&self, duration: Duration);
}
pub struct Userdata(u64);