Add basic preemptive scheduling

This commit is contained in:
Chuandong Li
2023-09-28 05:34:06 +00:00
committed by Tate, Hongliang Tian
parent baeaa9b4d3
commit e2b4302620
14 changed files with 336 additions and 144 deletions

View File

@ -2,7 +2,10 @@ use jinux_frame::timer::read_monotonic_milli_seconds;
use crate::{
prelude::*,
thread::{kernel_thread::KernelThreadExt, Thread},
thread::{
kernel_thread::{KernelThreadExt, ThreadOptions},
Thread,
},
};
use super::Iface;
@ -67,5 +70,5 @@ pub fn spawn_background_poll_thread(iface: Arc<dyn Iface>) {
}
}
};
Thread::spawn_kernel_thread(task_fn);
Thread::spawn_kernel_thread(ThreadOptions::new(task_fn));
}