implemented getter for objaddr

This commit is contained in:
Rémi Rativel 2023-04-05 16:43:09 +02:00
parent f246e84f91
commit f79b63e930

View File

@ -3,6 +3,8 @@
//! Module containing structs and methods pertaining to the state of the operating system
use super::{thread_manager::ThreadManager};
use crate::utility;
use crate::utility::objaddr::{ObjAddr, SynchObj};
/// # System
///
@ -14,12 +16,12 @@ use super::{thread_manager::ThreadManager};
/// - 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
pub struct System<'a> {
thread_manager: ThreadManager,
obj_addrs: ObjAddr<'a>
}
impl System {
impl<'a> System<'a> {
// GETTERS
@ -27,12 +29,14 @@ impl System {
&mut self.thread_manager
}
pub fn get_obj_addrs(&mut self) -> &'a mut ObjAddr { &mut self.obj_addrs }
}
impl Default for System {
impl<'a> Default for System<'a> {
/// System constructor
fn default() -> Self {
Self { thread_manager: ThreadManager::new() }
Self { thread_manager: ThreadManager::new(), obj_addrs: ObjAddr::init() }
}
}