added lock acquire system call

This commit is contained in:
Samy Solhi
2023-04-13 00:17:34 +02:00
parent 6e6d3424f5
commit 05f72af035
3 changed files with 48 additions and 5 deletions

View File

@@ -37,11 +37,11 @@ impl Semaphore {
pub struct Lock {
/// Thread owning the lock
owner: Option<Rc<RefCell<Thread>>>,
pub owner: Option<Rc<RefCell<Thread>>>,
/// The queue of threads waiting for execution
waiting_queue:List<Rc<RefCell<Thread>>>,
pub waiting_queue:List<Rc<RefCell<Thread>>>,
/// A boolean definig if the lock is free or not
free: bool
pub free: bool
}