wasi: make WasiSched::sleep fallible
some systems do not support sleeping and may want to return EINVAL here.
This commit is contained in:
@@ -128,8 +128,9 @@ impl WasiSched for SyncSched {
|
||||
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(())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user