wasi: make WasiSched::sleep fallible

some systems do not support sleeping and may want to return EINVAL here.
This commit is contained in:
Pat Hickey
2021-03-23 10:17:48 -07:00
parent 49ef2c652a
commit 81dfb9c458
5 changed files with 9 additions and 9 deletions

View File

@@ -108,8 +108,9 @@ impl WasiSched for SyncSched {
std::thread::yield_now();
Ok(())
}
fn sleep(&self, duration: Duration) {
std::thread::sleep(duration)
fn sleep(&self, duration: Duration) -> Result<(), Error> {
std::thread::sleep(duration);
Ok(())
}
}