Fix bug with sleep - wake is not cleared after it occurs
Do not initialize waitcondition with capacity
This commit is contained in:
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user