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) =>