X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=urcu%2Fhlist.h;h=15e672bc1702135ddfdb20b5676785dbd3cb2f55;hb=3d8fe30760fd4fb67ce24b5aa011ab75f680a904;hp=222a59ab854da278a5fbeb9d49b666206d7899a0;hpb=df65c98a4b6a3c3ba5e55c448521605fe14b6ec3;p=urcu.git diff --git a/urcu/hlist.h b/urcu/hlist.h index 222a59a..15e672b 100644 --- a/urcu/hlist.h +++ b/urcu/hlist.h @@ -39,6 +39,10 @@ static inline void CDS_INIT_HLIST_HEAD(struct cds_hlist_head *ptr) #define cds_hlist_entry(ptr, type, member) \ ((type *) ((char *) (ptr) - (unsigned long) (&((type *) 0)->member))) +/* Get first entry from a list. Assumes the hlist is not empty. */ +#define cds_hlist_first_entry(ptr, type, member) \ + cds_list_entry((ptr)->next, type, member) + static inline int cds_hlist_empty(struct cds_hlist_head *head) { return !head->next;