sched/wqueue: Improve performance of the work_queue.

This commit improve the performance of the work_queue by reducing
unnecessary wdog timer setting.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
ouyangxiangzhen
2025-05-08 11:24:46 +08:00
committed by archer
parent f442a41102
commit 36a4d5feaf
2 changed files with 22 additions and 24 deletions
-10
View File
@@ -90,16 +90,6 @@ static int work_qqueue(FAR struct usr_wqueue_s *wqueue,
work->arg = arg; /* Callback argument */
work->qtime = clock() + delay; /* Delay until work performed */
/* delay+1 is to prevent the insufficient sleep time if we are
* currently near the boundary to the next tick.
* | current_tick | current_tick + 1 | current_tick + 2 | .... |
* | ^ Here we get the current tick
* In this case we delay 1 tick, timer will be triggered at
* current_tick + 1, which is not enough for at least 1 tick.
*/
work->qtime += 1;
/* Insert the work into the wait queue sorted by the expired time. */
head = list_first_entry(&wqueue->q, struct work_s, node);