From caddc445b80185eacf63e572dbdb6d37b213ddd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Autin?= Date: Wed, 22 Mar 2023 16:03:36 +0100 Subject: [PATCH] Updated docs --- src/kernel/mgerror.rs | 4 ++-- src/kernel/synch.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kernel/mgerror.rs b/src/kernel/mgerror.rs index 54e0e58..dfe83c8 100644 --- a/src/kernel/mgerror.rs +++ b/src/kernel/mgerror.rs @@ -1,4 +1,4 @@ - +#![allow(unused, clippy::missing_docs_in_private_items)] /// Error enum, use it with Result pub enum ErrorCode { IncError, @@ -27,5 +27,5 @@ pub enum ErrorCode { WrongFileEndianess, NoAcia, - NUMMSGERROR /* Must always be last */ + NumMsgError /* Must always be last */ } \ No newline at end of file diff --git a/src/kernel/synch.rs b/src/kernel/synch.rs index 83345f6..ebd18cb 100644 --- a/src/kernel/synch.rs +++ b/src/kernel/synch.rs @@ -4,8 +4,6 @@ use crate::simulator::interrupt::InterruptStatus::InterruptOff; use crate::simulator::machine::Machine; use std::cell::RefCell; use std::rc::Rc; - -use super::system::System; use super::thread_manager::ThreadManager; /// Structure of a Semaphore used for synchronisation @@ -169,6 +167,8 @@ impl Lock { machine.interrupt.set_status(old_status); } + /// True if the current thread holds this lock. + /// Useful for checking in Release, and in Condition operations below. pub fn held_by_current_thread(&mut self, thread_manager: &mut ThreadManager) -> bool { match &self.owner { Some(x) =>