diff --git a/src/kernel/synch.rs b/src/kernel/synch.rs index 5a9eb93..b3a52f0 100644 --- a/src/kernel/synch.rs +++ b/src/kernel/synch.rs @@ -1,4 +1,5 @@ use crate::utility::list::List; +use crate::utility::objaddr::*; use crate::kernel::thread::Thread; use crate::simulator::interrupt::InterruptStatus::InterruptOff; use crate::simulator::machine::Machine; @@ -16,6 +17,8 @@ pub struct Semaphore { } +impl SynchObj for Semaphore {} + impl Semaphore { /// Initializes a semaphore, so that it can be used for synchronization. @@ -89,6 +92,8 @@ pub struct Lock{ } +impl SynchObj for Lock {} + impl Lock { /// Initialize a Lock, so that it can be used for synchronization. @@ -193,6 +198,8 @@ pub struct Condition{ } +impl SynchObj for Condition {} + impl Condition { /// Initializes a Condition, so that it can be used for synchronization. diff --git a/src/utility/objaddr.rs b/src/utility/objaddr.rs index d876056..c402f5d 100644 --- a/src/utility/objaddr.rs +++ b/src/utility/objaddr.rs @@ -15,7 +15,7 @@ pub trait SynchObj { } /// A method allows to detect of an object corresponding to a given /// identifier exists; this is used to check the parameters of system /// calls. -struct ObjAddr<'a> { +pub struct ObjAddr<'a> { last_id: i32, map: HashMap }