diff --git a/src/kernel/thread_manager.rs b/src/kernel/thread_manager.rs index 75e8c45..9a2e72e 100644 --- a/src/kernel/thread_manager.rs +++ b/src/kernel/thread_manager.rs @@ -137,7 +137,7 @@ impl ThreadManager { /// Finish the execution of the thread and prepare its deallocation pub fn thread_finish(&mut self, machine: &mut Machine, thread: Rc>) { let old_status = machine.interrupt.set_status(InterruptStatus::InterruptOff); - self.g_thread_to_be_destroyed = Option::Some(Rc::clone(&thread)); + self.set_g_thread_to_be_destroyed(Option::Some(Rc::clone(&thread))); self.g_alive.remove(Rc::clone(&thread)); #[cfg(debug_assertions)] println!("Sleeping thread {}", thread.borrow().get_name());