diff --git a/kernel/src/ipc/semary.rs b/kernel/src/ipc/semary.rs index 6770bf8c..178b2f61 100644 --- a/kernel/src/ipc/semary.rs +++ b/kernel/src/ipc/semary.rs @@ -61,7 +61,8 @@ pub fn new_semary(key: usize, nsems: usize, semflg: usize) -> Arc { let mut key2sem_table = KEY2SEM.write(); let mut sem_array_ref: Arc; - if key2sem_table.get(&key).is_none() { + let mut key_sem_array_ref = key2sem_table.get(&key); + if (key_sem_array_ref.is_none() || key_sem_array_ref.unwrap().upgrade().is_none()) { let mut semaphores: Vec = Vec::new(); for i in 0..nsems { semaphores.push(Semaphore::new(0)); diff --git a/user b/user index 11baf015..746114ac 160000 --- a/user +++ b/user @@ -1 +1 @@ -Subproject commit 11baf01577e0ca87ef88e6f1f95d2192e43e5d58 +Subproject commit 746114ac65b255ba7bdffba0445a162e767e0a6f