From: Mathieu Desnoyers Date: Fri, 24 Aug 2012 17:21:49 +0000 (-0400) Subject: hlist: implement cds_hlist_empty X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5f1bf1771eb7c512e6b44f9ad1e1c1f55ec0fe97;p=userspace-rcu.git hlist: implement cds_hlist_empty Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu/hlist.h b/urcu/hlist.h index d7d5c87..222a59a 100644 --- a/urcu/hlist.h +++ b/urcu/hlist.h @@ -39,6 +39,11 @@ 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))) +static inline int cds_hlist_empty(struct cds_hlist_head *head) +{ + return !head->next; +} + /* Add new element at the head of the list. */ static inline void cds_hlist_add_head (struct cds_hlist_node *newp, struct cds_hlist_head *head)