firmware: unbreak Io::sleep().

Fixes #663.
This commit is contained in:
whitequark 2017-01-27 17:20:22 +00:00
parent 82c4c61290
commit be0953d98f
1 changed files with 4 additions and 6 deletions

View File

@ -139,14 +139,12 @@ impl Scheduler {
thread.interrupted = false;
thread.generator.resume(WaitResult::Interrupted)
}
WaitRequest { event: Some(_), timeout: Some(instant) } if now >= instant =>
thread.generator.resume(WaitResult::TimedOut),
WaitRequest { event: None, timeout: Some(instant) } if now >= instant =>
thread.generator.resume(WaitResult::Completed),
WaitRequest { event: Some(event), timeout: _ } if unsafe { (*event)() } =>
thread.generator.resume(WaitResult::Completed),
WaitRequest { event: None, timeout: None } =>
thread.generator.resume(WaitResult::Completed),
WaitRequest { timeout: Some(instant), .. } if now >= instant =>
thread.generator.resume(WaitResult::TimedOut),
WaitRequest { event: Some(event), .. } if unsafe { (*event)() } =>
thread.generator.resume(WaitResult::Completed),
_ => {
if self.run_idx == start_idx {
// We've checked every thread and none of them are runnable.