From f5095d781b6aaf3f277c4d8087a85e652e193a65 Mon Sep 17 00:00:00 2001 From: ligd Date: Mon, 29 Apr 2024 16:23:32 +0800 Subject: [PATCH] wqueue: handle work_cancel() called in irq mode or idle thread Signed-off-by: ligd --- sched/wqueue/kwork_cancel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sched/wqueue/kwork_cancel.c b/sched/wqueue/kwork_cancel.c index 332d3fa90a..351d48d8b6 100644 --- a/sched/wqueue/kwork_cancel.c +++ b/sched/wqueue/kwork_cancel.c @@ -96,7 +96,7 @@ static int work_qcancel(FAR struct kwork_wqueue_s *wqueue, int nthread, work->worker = NULL; ret = OK; } - else if (nthread > 0) + else if (!up_interrupt_context() && !sched_idletask() && nthread > 0) { int wndx;