Added trait SynchObj to relevant structs
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user