Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/schedule/zephyr_dp_schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,9 @@ static void dp_thread_fn(void *p1, void *p2, void *p3)
struct task_dp_pdata *task_pdata = task->priv_data;
unsigned int lock_key;
enum task_state state;
bool task_stop;

while (1) {
do {
/*
* the thread is started immediately after creation, it will stop on semaphore
* Semaphore will be released once the task is ready to process
Expand Down Expand Up @@ -360,14 +361,13 @@ static void dp_thread_fn(void *p1, void *p2, void *p3)
}
}

if (task->state == SOF_TASK_STATE_COMPLETED ||
task->state == SOF_TASK_STATE_CANCEL)
break; /* exit the while loop, terminate the thread */
/* if true exit the while loop, terminate the thread */
task_stop = task->state == SOF_TASK_STATE_COMPLETED ||
task->state == SOF_TASK_STATE_CANCEL;

scheduler_dp_unlock(lock_key);
}
} while (!task_stop);

scheduler_dp_unlock(lock_key);
/* call task_complete */
if (task->state == SOF_TASK_STATE_COMPLETED)
task_complete(task);
Expand Down
Loading