From 6c19f66d622828449451cfea4ab58e72f1927fe3 Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Thu, 6 Apr 2023 13:48:37 +0200 Subject: [PATCH] use setter instead of modifying the field itself --- src/kernel/thread_manager.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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());