Fix a lot of errors

This commit is contained in:
Quentin Legot
2023-04-12 14:01:39 +02:00
parent e8629b1ebf
commit 134e2bd2cc
3 changed files with 24 additions and 21 deletions

View File

@ -48,20 +48,20 @@ impl ObjAddr {
/// Searches for a semaphore of id **id** in self
pub fn search_semaphore(&self, id: i32) -> Option<&mut Semaphore> {
self.semaphores.get(&id)
self.semaphores.get_mut(&id)
}
/// Searches for a lock of id **id** in self
pub fn search_lock(&self, id:i32) -> Option<&mut Lock> {
self.locks.get(&id)
self.locks.get_mut(&id)
}
/// Removes the object of id **id** from self if it exists
pub fn remove_semaphore(&mut self, id: i32) {
pub fn remove_semaphore(&mut self, id: i32) -> Option<Semaphore> {
self.semaphores.remove(&id)
}
pub fn remove_semaphore(&mut self, id:i32) {
pub fn remove_lock(&mut self, id:i32) -> Option<Lock> {
self.locks.remove(&id)
}