Fix bug with sleep - wake is not cleared after it occurs

Do not initialize waitcondition with capacity
This commit is contained in:
Jeremy Soller
2017-03-21 20:30:46 -06:00
parent ffd7594971
commit 906ef94ffd
2 changed files with 2 additions and 1 deletions

View File

@@ -45,6 +45,7 @@ pub unsafe fn switch() -> bool {
let current = arch::time::monotonic();
if current.0 > wake.0 || (current.0 == wake.0 && current.1 >= wake.1) {
context.wake = None;
context.unblock();
}
}

View File

@@ -12,7 +12,7 @@ pub struct WaitCondition {
impl WaitCondition {
pub fn new() -> WaitCondition {
WaitCondition {
contexts: Mutex::new(Vec::with_capacity(16))
contexts: Mutex::new(Vec::new())
}
}