Skip to content

Commit 85e1c0d

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 869c08d commit 85e1c0d

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
@@ -257,6 +257,13 @@ static int _schedule_task(struct task *task, uint64_t start, uint64_t deadline)
257257
return 0;
258258
}
259259

260+
/* is task already running ? - not enough MIPS to complete ? */
261+
if (task->state == TASK_STATE_QUEUED) {
262+
trace_pipe("tsq");
263+
spin_unlock_irq(&sch->lock, flags);
264+
return 0;
265+
}
266+
260267
/* get the current time */
261268
current = platform_timer_get(platform_timer);
262269

0 commit comments

Comments
 (0)