From 82c2eca278b5ecd9ddcca89d4170f9e6dd5ba015 Mon Sep 17 00:00:00 2001 From: Yifan Wu Date: Sat, 21 May 2022 16:03:42 -0700 Subject: [PATCH] Issue #60: added some comments about mutex/semaphore. --- os/src/task/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/os/src/task/mod.rs b/os/src/task/mod.rs index b66490b8..94eb18bb 100644 --- a/os/src/task/mod.rs +++ b/os/src/task/mod.rs @@ -93,6 +93,10 @@ pub fn exit_current_and_run_next(exit_code: i32) { let task = task.as_ref().unwrap(); // if other tasks are Ready in TaskManager or waiting for a timer to be // expired, we should remove them. + // + // Mention that we do not need to consider Mutex/Semaphore since they + // are limited in a single process. Therefore, the blocked tasks are + // removed when the PCB is deallocated. remove_inactive_task(Arc::clone(&task)); let mut task_inner = task.inner_exclusive_access(); if let Some(res) = task_inner.res.take() {