mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-28 20:03:22 +00:00
Don't race between enabling IRQs and halting CPU
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
b96c8f9ed2
commit
35e0918bce
@ -111,8 +111,7 @@ fn ap_init() {
|
||||
);
|
||||
|
||||
loop {
|
||||
crate::thread::Thread::yield_now();
|
||||
ostd::cpu::sleep_for_interrupt();
|
||||
ostd::task::halt_cpu();
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,10 +155,10 @@ fn init_thread() {
|
||||
karg.get_initproc_envp().to_vec(),
|
||||
)
|
||||
.expect("Run init process failed.");
|
||||
|
||||
// Wait till initproc become zombie.
|
||||
while !initproc.status().is_zombie() {
|
||||
crate::thread::Thread::yield_now();
|
||||
ostd::cpu::sleep_for_interrupt();
|
||||
ostd::task::halt_cpu();
|
||||
}
|
||||
|
||||
// TODO: exit via qemu isa debug device should not be the only way.
|
||||
|
Reference in New Issue
Block a user