Don't preempt without good reason

This commit is contained in:
Ruihan Li
2024-10-31 10:00:19 +08:00
committed by Tate, Hongliang Tian
parent 19b13d88e2
commit 5233827160
6 changed files with 32 additions and 16 deletions

View File

@ -93,8 +93,6 @@ pub fn main() {
ThreadOptions::new(init_thread)
.priority(Priority::new(PriorityRange::new(PriorityRange::MAX))),
);
// Spawning functions in the bootstrap context will not return.
unreachable!()
}
pub fn init() {
@ -110,7 +108,7 @@ pub fn init() {
process::init();
}
fn ap_init() -> ! {
fn ap_init() {
fn ap_idle_thread() {
let preempt_guard = ostd::task::disable_preempt();
let cpu_id = preempt_guard.current_cpu();
@ -129,8 +127,6 @@ fn ap_init() -> ! {
.cpu_affinity(cpu_id.into())
.priority(Priority::new(PriorityRange::new(PriorityRange::MAX))),
);
// Spawning functions in the bootstrap context will not return.
unreachable!()
}
fn init_thread() {