update synch.rs

This commit is contained in:
Samy Solhi
2023-03-15 16:28:29 +01:00
parent 1906ec836c
commit b22b1dea21
4 changed files with 87 additions and 58 deletions

View File

@ -70,7 +70,7 @@ impl ThreadManager {
if let Some(next_thread) = next_thread {
let scheduler = &mut self.g_scheduler;
scheduler.ready_to_run(thread);
scheduler.switch_to(system, next_thread);
scheduler.switch_to(next_thread);
}
machine.interrupt.set_status(old_status);
}
@ -86,7 +86,7 @@ impl ThreadManager {
machine.interrupt.idle();
next_thread = self.g_scheduler.find_next_to_run();
}
self.g_scheduler.switch_to(system, Rc::clone(&next_thread.unwrap()));
self.g_scheduler.switch_to(Rc::clone(&next_thread.unwrap()));
}
/// Finish the execution of the thread and prepare its deallocation