X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=urcu%2Flist.h;h=d26751204192993c68c48010f7e931e18c6bfa2b;hb=a45fb1ffc0af634583bc8b3739e3416600d8928e;hp=82c2ea4b9375855313c5b6cfaa5922415dfdeaea;hpb=63ff4873e046ba582d20e79ebff16ee7da2aa92f;p=urcu.git diff --git a/urcu/list.h b/urcu/list.h index 82c2ea4..d267512 100644 --- a/urcu/list.h +++ b/urcu/list.h @@ -80,6 +80,24 @@ list_del (list_t *elem) __list_del (elem->prev, elem->next); } +/* delete from list, add to another list as head */ +static inline void +list_move (list_t *elem, list_t *head) +{ + __list_del (elem->prev, elem->next); + 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