From ce4c7230f996fb37d0aea80fc1bf1005b0166fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Autin?= Date: Fri, 21 Apr 2023 14:50:55 +0200 Subject: [PATCH] :memo: Updated utility mod documentation --- src/utility/mod.rs | 3 +++ src/utility/objaddr.rs | 4 ++++ 2 files changed, 7 insertions(+) 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>>, }