Skip to content

Commit

Permalink
Issue #60: added some comments about mutex/semaphore.
Browse files Browse the repository at this point in the history
  • Loading branch information
wyfcyx committed May 21, 2022
1 parent fcfd5b6 commit 82c2eca
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions os/src/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 82c2eca

Please sign in to comment.