Skip to content

Commit 8c3917d

Browse files
committed
schedule: fix schedule list double add
Check if the schedule task is added in the list before add it. Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
1 parent f517f75 commit 8c3917d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/lib/schedule.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,13 @@ static int _schedule_task(struct task *task, uint64_t start, uint64_t deadline)
269269
return 0;
270270
}
271271

272+
/* is task already running ? - not enough MIPS to complete ? */
273+
if (task->state == TASK_STATE_QUEUED) {
274+
trace_pipe("tsq");
275+
spin_unlock_irq(&sch->lock, flags);
276+
return 0;
277+
}
278+
272279
/* get the current time */
273280
current = platform_timer_get(platform_timer);
274281

0 commit comments

Comments
 (0)