hlist: implement cds_hlist_empty
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 24 Aug 2012 17:21:49 +0000 (13:21 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 14 May 2013 14:22:23 +0000 (16:22 +0200)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu/hlist.h

index d7d5c87f1c28d1c3710ed1d1bb4a08f0751b3a55..222a59ab854da278a5fbeb9d49b666206d7899a0 100644 (file)
@@ -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)
This page took 0.027301 seconds and 4 git commands to generate.