mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-06-07 06:11:56 +00:00
[bugfix] preempt, avoid deadlock
This commit is contained in:
parent
63c121ae73
commit
3258e7d784
@ -123,6 +123,7 @@ func (scheduler *SchedulerPriority) Start() {
|
|||||||
copy(scheduler.history[idx:], scheduler.history[idx+1:])
|
copy(scheduler.history[idx:], scheduler.history[idx+1:])
|
||||||
scheduler.history = scheduler.history[:len(scheduler.history)-1]
|
scheduler.history = scheduler.history[:len(scheduler.history)-1]
|
||||||
}
|
}
|
||||||
|
scheduler.historyMu.Unlock()
|
||||||
|
|
||||||
/* add back */
|
/* add back */
|
||||||
idx = len(scheduler.queue)
|
idx = len(scheduler.queue)
|
||||||
@ -149,8 +150,9 @@ func (scheduler *SchedulerPriority) Start() {
|
|||||||
log.Info("before=", before, " after=", after)
|
log.Info("before=", before, " after=", after)
|
||||||
time.Sleep(time.Millisecond * 100)
|
time.Sleep(time.Millisecond * 100)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
scheduler.historyMu.Unlock()
|
||||||
}
|
}
|
||||||
scheduler.historyMu.Unlock()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scheduler.queueMu.Unlock()
|
scheduler.queueMu.Unlock()
|
||||||
|
Loading…
Reference in New Issue
Block a user