diff --git a/src/context/switch.rs b/src/context/switch.rs index bbdc8ad..60cd46b 100644 --- a/src/context/switch.rs +++ b/src/context/switch.rs @@ -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(); } } diff --git a/src/sync/wait_condition.rs b/src/sync/wait_condition.rs index cb17026..d48af9d 100644 --- a/src/sync/wait_condition.rs +++ b/src/sync/wait_condition.rs @@ -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()) } }