Skip to content
Snippets Groups Projects
Commit 906ef94f authored by Jeremy Soller's avatar Jeremy Soller
Browse files

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

Do not initialize waitcondition with capacity
parent ffd75949
No related branches found
No related tags found
No related merge requests found
......@@ -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();
}
}
......
......@@ -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())
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment