projects
/
userspace-rcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hlist: implement cds_hlist_first_entry_rcu
[userspace-rcu.git]
/
urcu
/
rcuhlist.h
diff --git
a/urcu/rcuhlist.h
b/urcu/rcuhlist.h
index 8549550e7fab3358fd031b30ed87ff67244f1472..4635593b4cb00449dd1fe82ebc70e70da3743cef 100644
(file)
--- a/
urcu/rcuhlist.h
+++ b/
urcu/rcuhlist.h
@@
-50,6
+50,12
@@
static inline void cds_hlist_del_rcu(struct cds_hlist_node *elem)
elem->prev->next = elem->next;
}
elem->prev->next = elem->next;
}
+/*
+ * Get first entry from a RCU hlist. Assumes the hlist is not empty.
+ * This must be done while rcu_read_lock() is held.
+ */
+#define cds_hlist_first_entry_rcu(ptr, type, member) \
+ cds_hlist_entry(rcu_dereference((ptr)->next), type, member)
/* Iterate through elements of the list.
* This must be done while rcu_read_lock() is held.
/* Iterate through elements of the list.
* This must be done while rcu_read_lock() is held.
This page took
0.034215 seconds
and
4
git commands to generate.