将当前的sched_cfs函数做一个包裹,套一层sched(). (#32)

* 将当前的sched_cfs函数做一个包裹,套一层sched().

* 用sched()包裹sched_cfs(),用sched_enqueue()包裹sched_cfs_enqueue()

* 用sched()包裹sched_cfs(),用sched_enqueue()包裹sched_cfs_enqueue(),并替换

* bugfix: 修正拼写错误导致的编译错误

* 修正拼写错误

Co-authored-by: fslongjin <longjin@RinGoTek.cn>
This commit is contained in:
houmkh
2022-08-31 07:59:31 +08:00
committed by GitHub
parent 8bc8890070
commit 1a2d405384
10 changed files with 59 additions and 28 deletions

View File

@ -17,7 +17,7 @@ void mutex_init(mutex_t *lock)
static void __mutex_sleep()
{
current_pcb->state = PROC_UNINTERRUPTIBLE;
sched_cfs();
sched();
}
static void __mutex_acquire(mutex_t *lock)

View File

@ -18,7 +18,7 @@ void semaphore_down(semaphore_t *sema)
list_append(&sema->wait_queue.wait_list, &wait.wait_list);
// 执行调度
sched_cfs();
sched();
}
}
@ -35,7 +35,7 @@ void semaphore_up(semaphore_t *sema)
list_del(&wq->wait_list);
wq->pcb->state = PROC_RUNNING;
sched_cfs_enqueue(wq->pcb);
sched_enqueue(wq->pcb);
// 当前进程缺少需要的资源,立即标为需要被调度
current_pcb->flags |= PF_NEED_SCHED;

View File

@ -28,7 +28,7 @@ void wait_queue_sleep_on(wait_queue_node_t *wait_queue_head)
current_pcb->state = PROC_UNINTERRUPTIBLE;
list_append(&wait_queue_head->wait_list, &wait->wait_list);
sched_cfs();
sched();
}
/**
@ -44,7 +44,7 @@ void wait_queue_sleep_on_unlock(wait_queue_node_t *wait_queue_head,
current_pcb->state = PROC_UNINTERRUPTIBLE;
list_append(&wait_queue_head->wait_list, &wait->wait_list);
spin_unlock((spinlock_t *)lock);
sched_cfs();
sched();
}
/**
@ -59,7 +59,7 @@ void wait_queue_sleep_on_interriptible(wait_queue_node_t *wait_queue_head)
current_pcb->state = PROC_INTERRUPTIBLE;
list_append(&wait_queue_head->wait_list, &wait->wait_list);
sched_cfs();
sched();
}
/**