X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu%2Flist.h;h=1d1c7b5ce2882b6bd0e13b53b096c081dbcb1b44;hb=ed1b099ef8acd1396dbde7c7150d1a5eb16ce8a6;hp=f27ff7ba7900ddcf17ba9be95087d1bd4fee1c5f;hpb=bdffa73aa208ad5f1e5b3a3cb6cbf86ac6996559;p=urcu.git diff --git a/urcu/list.h b/urcu/list.h index f27ff7b..1d1c7b5 100644 --- a/urcu/list.h +++ b/urcu/list.h @@ -140,12 +140,17 @@ cds_list_splice (struct cds_list_head *add, struct cds_list_head *head) #define cds_list_for_each(pos, head) \ for (pos = (head)->next; pos != (head); pos = pos->next) +/* Iterate forward over the elements list. The list elements can be + removed from the list while doing this. */ +#define cds_list_for_each_safe(pos, p, head) \ + for (pos = (head)->next, p = pos->next; \ + pos != (head); \ + pos = p, p = pos->next) -/* Iterate forward over the elements of the list. */ +/* Iterate backward over the elements of the list. */ #define cds_list_for_each_prev(pos, head) \ for (pos = (head)->prev; pos != (head); pos = pos->prev) - /* Iterate backwards over the elements list. The list elements can be removed from the list while doing this. */ #define cds_list_for_each_prev_safe(pos, p, head) \