34 lines
798 B
Rust
34 lines
798 B
Rust
//! # 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
|
|
pub struct System {
|
|
thread_manager: ThreadManager
|
|
}
|
|
|
|
impl System {
|
|
|
|
pub fn new(debug: bool) -> Self {
|
|
Self { thread_manager: ThreadManager::new(debug) }
|
|
}
|
|
|
|
// GETTERS
|
|
|
|
pub fn get_thread_manager(&mut self) -> &mut ThreadManager {
|
|
&mut self.thread_manager
|
|
}
|
|
|
|
}
|