Skip to content

Commit

Permalink
fix(task)!: work around, do not panic when arc parent can not upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenRuiwei committed Aug 19, 2024
1 parent 14f407f commit c9b1625
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions kernel/src/task/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,15 +619,18 @@ impl Task {

// NOTE: leader will be removed by parent calling `sys_wait4`
if let Some(parent) = self.parent() {
let parent = parent.upgrade().unwrap();
parent.receive_siginfo(
SigInfo {
sig: Sig::SIGCHLD,
code: SigInfo::CLD_EXITED,
details: SigDetails::None,
},
false,
);
if let Some(parent) = parent.upgrade() {
parent.receive_siginfo(
SigInfo {
sig: Sig::SIGCHLD,
code: SigInfo::CLD_EXITED,
details: SigDetails::None,
},
false,
)
} else {
log::error!("no arc parent");
}
}

// Upon _exit(2), all attached shared memory segments are detached from the
Expand Down

0 comments on commit c9b1625

Please sign in to comment.