Skip to content

Commit c9e84ae

Browse files
committed
dp: .cancel() isn't used, make it explicit
DP scheduler's .cancel() method is so far unused, make it panic to avoid accidental use. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 34f9a9f commit c9e84ae

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/schedule/zephyr_dp_schedule.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,19 @@ void scheduler_dp_ll_tick(void *receiver_data, enum notify_id event_type, void *
241241
scheduler_dp_unlock(lock_key);
242242
}
243243

244-
// FIXME: is .cancel() always followed by .free()? Where should we free stack and thread?
245244
static int scheduler_dp_task_cancel(void *data, struct task *task)
245+
{
246+
/* Should never be called */
247+
k_panic();
248+
return -EOPNOTSUPP;
249+
}
250+
251+
static int scheduler_dp_task_stop(void *data, struct task *task)
246252
{
247253
unsigned int lock_key;
248254
struct scheduler_dp_data *dp_sch = (struct scheduler_dp_data *)data;
249255
struct task_dp_pdata *pdata = task->priv_data;
250256

251-
252257
/* this is asyn cancel - mark the task as canceled and remove it from scheduling */
253258
lock_key = scheduler_dp_lock(cpu_get_id());
254259

@@ -279,7 +284,7 @@ static int scheduler_dp_task_free(void *data, struct task *task)
279284
struct task_dp_pdata *pdata = task->priv_data;
280285
int ret;
281286

282-
scheduler_dp_task_cancel(data, task);
287+
scheduler_dp_task_stop(data, task);
283288

284289
/* the thread should be terminated at this moment,
285290
* abort is safe and will ensure no use after free

0 commit comments

Comments
 (0)