From ac956d0065c8a69073a90a0cb230190723d294cb Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 28 Sep 2009 22:20:03 -0400 Subject: [PATCH] list.h: add list_move Signed-off-by: Mathieu Desnoyers --- urcu/list.h | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.34.1