sched/wdog: Faster wdog deleting.

This commit reduced 1 write operation for wdog deleting and decoupled
the WDOG_ISACTIVE with the list implementation.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
ouyangxiangzhen
2025-12-22 16:13:55 +08:00
committed by Xiang Xiao
parent 694dfc7a0c
commit 476e02c7e0
4 changed files with 20 additions and 8 deletions
+10 -3
View File
@@ -138,20 +138,27 @@
} \
while (0)
#define list_delete(item) \
#define list_delete_fast(item) \
do \
{ \
FAR struct list_node *__item = (item); \
__item->next->prev = __item->prev; \
__item->prev->next = __item->next; \
__item->prev = __item->next = NULL; \
} \
while (0)
#define list_delete(item) \
do \
{ \
list_delete_fast(item); \
list_clear_node(item); \
} \
while (0)
#define list_delete_init(item) \
do \
{ \
list_delete(item); \
list_delete_fast(item); \
list_initialize(item); \
} \
while (0)
+1 -1
View File
@@ -39,7 +39,7 @@
* Pre-processor Definitions
****************************************************************************/
#define WDOG_ISACTIVE(w) (list_in_list(&((w)->node)))
#define WDOG_ISACTIVE(w) ((w)->func != NULL)
/* The maximum delay tick are supposed to be CLOCK_MAX >> 1.
* However, if there are expired wdog timers in the wdog queue,