RT-Thread内核-rt_list_for_each

1、原型

/**
 * rt_list_for_each - iterate over a list
 * @pos:	the rt_list_t * to use as a loop cursor.
 * @head:	the head for your list.
 */
#define rt_list_for_each(pos, head) \
    for (pos = (head)->next; pos != (head); pos = pos->next)

2、作用

遍历一个双向链表

3、参数

参数 pos:遍历链表需要用到的临时变量

参数 head:需要遍历的链表的头指针

 

你可能感兴趣的:(RT-Thread,RT-Thread)