use setter instead of modifying the field itself

This commit is contained in:
Quentin Legot 2023-04-06 13:48:37 +02:00
parent 66d6daf0b9
commit 6c19f66d62

View File

@ -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<RefCell<Thread>>) {
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());