diff --git a/src/utility/mod.rs b/src/utility/mod.rs index c6db391..85e59cc 100644 --- a/src/utility/mod.rs +++ b/src/utility/mod.rs @@ -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 objaddr; pub mod cfg; \ No newline at end of file diff --git a/src/utility/objaddr.rs b/src/utility/objaddr.rs index 42ad0a5..b2847e6 100644 --- a/src/utility/objaddr.rs +++ b/src/utility/objaddr.rs @@ -17,9 +17,13 @@ use crate::kernel::{synch::{ Semaphore, Lock }, thread::Thread}; /// calls. #[derive(PartialEq)] pub struct ObjAddr { + /// Id of the last added object last_id: i32, + /// List of [Semaphore] added in this struct. Each is keyed with a unique i32 id. semaphores: HashMap, + /// List of [Lock] added in this struct. Each is keyed with a unique i32 id. locks: HashMap, + /// List of threads known by this instance of ObjAddr (useful for managing lock ownership) threads: HashMap>>, }