skip calling ticks when the sleep queue is empty
Этот коммит содержится в:
родитель
b66b15d02c
коммит
c4dff990d9
1 изменённых файлов: 4 добавлений и 1 удалений
|
@ -226,10 +226,13 @@ func addSleepTask(t *task, duration int64) {
|
|||
// Run the scheduler until all tasks have finished.
|
||||
func scheduler() {
|
||||
// Main scheduler loop.
|
||||
var now timeUnit
|
||||
for {
|
||||
scheduleLog("")
|
||||
scheduleLog(" schedule")
|
||||
now := ticks()
|
||||
if sleepQueue != nil {
|
||||
now = ticks()
|
||||
}
|
||||
|
||||
// Add tasks that are done sleeping to the end of the runqueue so they
|
||||
// will be executed soon.
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче