From: Mathieu Desnoyers Date: Tue, 29 Sep 2009 02:20:03 +0000 (-0400) Subject: list.h: add list_move X-Git-Tag: v0.1~13 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ac956d0065c8a69073a90a0cb230190723d294cb;p=urcu.git list.h: add list_move Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu/list.h b/urcu/list.h index 82c2ea4..6384728 100644 --- a/urcu/list.h +++ b/urcu/list.h @@ -80,6 +80,13 @@ 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); +} /* Join two lists. */ static inline void