1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-06-07 22:31:55 +00:00

update preempt

This commit is contained in:
Newnius 2020-06-04 11:08:51 +08:00
parent 4d95d15749
commit 1925aa0eaa

View File

@ -76,6 +76,9 @@ func (scheduler *SchedulerPriority) Start() {
lowest := preemptee.Priority - 1 lowest := preemptee.Priority - 1
scheduler.historyMu.Lock() scheduler.historyMu.Lock()
for _, job := range scheduler.history { for _, job := range scheduler.history {
if job.Status != Running {
continue
}
if job.Priority < lowest { if job.Priority < lowest {
jobs = []Job{*job} jobs = []Job{*job}
lowest = job.Priority lowest = job.Priority