RCU lock-free queue: don't hold RCU read lock across retry
[urcu.git] / urcu / list.h
index 6384728bc054d551fccd811cec27f43dc41d61da..888e776fd3b9309470aa5c552e77745744aedda5 100644 (file)
@@ -88,6 +88,17 @@ list_move (list_t *elem, list_t *head)
   list_add (elem, head);
 }
 
+/* replace an old entry.
+ */
+static inline void
+list_replace(list_t *old, list_t *_new)
+{
+       _new->next = old->next;
+       _new->prev = old->prev;
+       _new->prev->next = _new;
+       _new->next->prev = _new;
+}
+
 /* Join two lists.  */
 static inline void
 list_splice (list_t *add, list_t *head)
@@ -148,11 +159,11 @@ static inline int list_empty(list_t *head)
 }
 
 static inline void list_replace_init(list_t *old,
-                                    list_t *new)
+                                    list_t *_new)
 {
        list_t *head = old->next;
        list_del(old);
-       list_add_tail(new, head);
+       list_add_tail(_new, head);
        INIT_LIST_HEAD(old);
 }
 
This page took 0.02407 seconds and 4 git commands to generate.