📝 Updated utility mod documentation

This commit is contained in:
François Autin 2023-04-21 14:50:55 +02:00
parent 33cbe77175
commit ce4c7230f9
No known key found for this signature in database
GPG Key ID: 343F5D382E1DD77C
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,6 @@
//! This module contains data type definitions used in other parts the BurritOS
//! They are separated from the rest of the operating system so as to promote
//! reusability and to separate data constructs proper from state and actions.
pub mod list; pub mod list;
pub mod objaddr; pub mod objaddr;
pub mod cfg; pub mod cfg;

View File

@ -17,9 +17,13 @@ use crate::kernel::{synch::{ Semaphore, Lock }, thread::Thread};
/// calls. /// calls.
#[derive(PartialEq)] #[derive(PartialEq)]
pub struct ObjAddr { pub struct ObjAddr {
/// Id of the last added object
last_id: i32, last_id: i32,
/// List of [Semaphore] added in this struct. Each is keyed with a unique i32 id.
semaphores: HashMap<i32, Semaphore>, semaphores: HashMap<i32, Semaphore>,
/// List of [Lock] added in this struct. Each is keyed with a unique i32 id.
locks: HashMap<i32, Lock>, locks: HashMap<i32, Lock>,
/// List of threads known by this instance of ObjAddr (useful for managing lock ownership)
threads: HashMap<i32, Rc<RefCell<Thread>>>, threads: HashMap<i32, Rc<RefCell<Thread>>>,
} }