mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
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:
committed by
Xiang Xiao
parent
694dfc7a0c
commit
476e02c7e0
+10
-3
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user