Skip to content

Commit

Permalink
update toolchain version
Browse files Browse the repository at this point in the history
  • Loading branch information
Godones committed Jan 17, 2024
1 parent 2e8213e commit b470f78
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 27 deletions.
44 changes: 18 additions & 26 deletions kernel/src/task/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,28 @@ use crate::trap::check_timer_interrupt_pending;
/// 否则该 CPU 将进入等待状态,等待其它核的中断信号。
pub fn run_task() -> ! {
loop {
{
let cpu = current_cpu();
if cpu.task.is_some() {
let task = cpu.task.take().unwrap();
match task.state() {
TaskState::Waiting => {
// drop(task);
}
TaskState::Zombie => {
// 退出时向父进程发送信号,其中选项可被 sys_clone 控制
if task.send_sigchld_when_exit || task.pid == task.tid.0 {
let parent = task
.access_inner()
.parent
.clone()
.unwrap()
.upgrade()
.unwrap();
send_signal(parent.pid, SignalNumber::SIGCHLD as usize);
}
// 通知全局表将 signals 删除
task.terminate();
}
_ => {
GLOBAL_TASK_MANAGER.add_task(Arc::new(FifoTask::new(task)));
let cpu = current_cpu();
if cpu.task.is_some() {
let task = cpu.task.take().unwrap();
match task.state() {
TaskState::Waiting => {
// drop(task);
}
TaskState::Zombie => {
// 退出时向父进程发送信号,其中选项可被 sys_clone 控制
if task.send_sigchld_when_exit || task.pid == task.tid.0 {
let parent = task
.access_inner()
.parent.as_ref().unwrap().upgrade().unwrap();
send_signal(parent.pid, SignalNumber::SIGCHLD as usize);
}
task.terminate();
}
_ => {
GLOBAL_TASK_MANAGER.add_task(Arc::new(FifoTask::new(task)));
}
}
}
let cpu = current_cpu();
if let Some(task) = GLOBAL_TASK_MANAGER.pick_next_task() {
// if process.get_tid() >= 1 {
// warn!("switch to task {}", task.get_tid());
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2023-11-05"
channel = "nightly-2023-12-01"
components = ["rust-src", "llvm-tools-preview", "rustfmt", "clippy"]
targets = ["riscv64gc-unknown-none-elf"]

0 comments on commit b470f78

Please sign in to comment.