sched: Fix kernel panic (1 -> idle, idle -> idle)

This commit is contained in:
Mark Poliakov 2023-07-18 19:22:30 +03:00
parent 0e6cb88756
commit 058bfddd58

View File

@ -115,20 +115,7 @@ impl CpuQueue {
// Start from idle thread to avoid having a Rc stuck here without getting dropped
let t = CNTPCT_EL0.get();
self.lock().stats.measure_time = t;
let mut inner = self.inner.lock();
if let Some(proc) = inner.next_ready_task() {
inner.queue.push_back(proc.clone());
inner.current = Some(proc.clone());
proc.set_running(Cpu::local_id());
drop(inner);
proc.context().enter();
} else {
drop(inner);
self.idle.enter();
};
self.idle.enter()
}
/// Yields CPU execution to the next task in queue (or idle task if there aren't any).
@ -177,6 +164,7 @@ impl CpuQueue {
(&self.idle, 0)
};
// log_print_raw!(crate::debug::LogLevel::Info, "{}: ", Cpu::local_id());
// if let Some(from) = current.as_ref() {
// log_print_raw!(crate::debug::LogLevel::Info, "{}", from.id());
// } else {