1
0
forked from Rativel/BurritOS

use of system in parameters in synch

This commit is contained in:
Quentin Legot
2023-03-15 11:09:34 +01:00
parent e5242aab0c
commit c8df1e5053
5 changed files with 138 additions and 114 deletions

View File

@@ -12,7 +12,10 @@ macro_rules! init_system {
init_system!(m)
}};
($a:expr) => {{
System::new($a)
let sys = std::rc::Rc::new(std::cell::RefCell::new(crate::System::new($a)));
crate::System::freeze(std::rc::Rc::clone(&sys));
sys
}};
}
@@ -59,6 +62,10 @@ impl System {
&self.g_machine
}
pub fn get_thread_manager(&self) -> Rc<RefCell<ThreadManager>> {
Rc::clone(&self.thread_manager)
}
// Setters
/// Assign a machine to the system