Rewrite exit() and exit_group()

This commit is contained in:
Ruihan Li
2024-11-23 22:08:38 +08:00
committed by Tate, Hongliang Tian
parent 5efc32b6ea
commit 35c20620bc
24 changed files with 364 additions and 249 deletions

View File

@ -150,14 +150,14 @@ fn init_thread() {
)
.expect("Run init process failed.");
// Wait till initproc become zombie.
while !initproc.is_zombie() {
while !initproc.status().is_zombie() {
// We don't have preemptive scheduler now.
// The long running init thread should yield its own execution to allow other tasks to go on.
Thread::yield_now();
}
// TODO: exit via qemu isa debug device should not be the only way.
let exit_code = if initproc.exit_code() == 0 {
let exit_code = if initproc.status().exit_code() == 0 {
QemuExitCode::Success
} else {
QemuExitCode::Failed