work_q: Make k_delayed_work_cancel cancel work already pending
This has been a limitation caused by k_fifo which could only remove items from the beggining, but with the change to use k_queue in k_work_q it is now possible to remove items from any position with use of k_queue_remove. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
adb581be8e
commit
c1fa82b3c6
3 changed files with 18 additions and 14 deletions
|
@ -2049,7 +2049,7 @@ static inline void k_work_submit_to_queue(struct k_work_q *work_q,
|
|||
struct k_work *work)
|
||||
{
|
||||
if (!atomic_test_and_set_bit(work->flags, K_WORK_STATE_PENDING)) {
|
||||
k_fifo_put(&work_q->queue, work);
|
||||
k_queue_append(&work_q->queue, work);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue