//! # System module //! //! Module containing structs and methods pertaining to the state of the operating system use super::{thread_manager::ThreadManager}; /// # System /// /// This structure represents the state of the threads running on the operating system. /// It contains references to the following: /// /// - The simulated machine /// - The current running thread /// - The list of active threads /// - The thread to be destroyed next /// - The scheduler which acts upon these threads #[derive(PartialEq)] pub struct System { thread_manager: ThreadManager } impl System { // GETTERS pub fn get_thread_manager(&mut self) -> &mut ThreadManager { &mut self.thread_manager } } impl Default for System { /// System constructor fn default() -> Self { Self { thread_manager: ThreadManager::new() } } } #[derive(PartialEq, Debug)] pub enum ObjectType { SemaphoreType, LockType, ConditionType, FileType, ThreadType, InvalidType }