projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LOAD_SHARED and STORE_SHARED should have CMM_ prefix
[urcu.git]
/
urcu
/
rculfstack-static.h
diff --git
a/urcu/rculfstack-static.h
b/urcu/rculfstack-static.h
index 8eae35d1bc0d2c9fc12955d6c5185f3bcb1ecfbb..f541d40508f1ee05d3f046cb0f0d5add5f18c48c 100644
(file)
--- a/
urcu/rculfstack-static.h
+++ b/
urcu/rculfstack-static.h
@@
-33,53
+33,48
@@
extern "C" {
#endif
extern "C" {
#endif
-void _
rcu_lfs_node_init(struct rcu_lfs_node
*node)
+void _
cds_lfs_node_init_rcu(struct cds_lfs_node_rcu
*node)
{
}
{
}
-void _
rcu_lfs_init(struct rcu_lfs_stack
*s)
+void _
cds_lfs_init_rcu(struct cds_lfs_stack_rcu
*s)
{
s->head = NULL;
}
{
s->head = NULL;
}
-void _
rcu_lfs_push(struct rcu_lfs_stack *s, struct rcu_lfs_node
*node)
+void _
cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s, struct cds_lfs_node_rcu
*node)
{
{
+ struct cds_lfs_node_rcu *head = NULL;
+
for (;;) {
for (;;) {
- struct
rcu_lfs_node *
head;
+ struct
cds_lfs_node_rcu *old_head =
head;
- rcu_read_lock();
- head = rcu_dereference(s->head);
node->next = head;
/*
* uatomic_cmpxchg() implicit memory barrier orders earlier
* stores to node before publication.
*/
node->next = head;
/*
* uatomic_cmpxchg() implicit memory barrier orders earlier
* stores to node before publication.
*/
- if (uatomic_cmpxchg(&s->head, head, node) == head) {
- rcu_read_unlock();
- return;
- } else {
- /* Failure to prepend. Retry. */
- rcu_read_unlock();
- continue;
- }
+ head = uatomic_cmpxchg(&s->head, old_head, node);
+ if (old_head == head)
+ break;
}
}
/*
* The caller must wait for a grace period to pass before freeing the returned
}
}
/*
* The caller must wait for a grace period to pass before freeing the returned
- * node or modifying the
rcu_lfs_node
structure.
+ * node or modifying the
cds_lfs_node_rcu
structure.
* Returns NULL if stack is empty.
*/
* Returns NULL if stack is empty.
*/
-struct
rcu_lfs_node
*
-_
rcu_lfs_pop(struct rcu_lfs_stack
*s)
+struct
cds_lfs_node_rcu
*
+_
cds_lfs_pop_rcu(struct cds_lfs_stack_rcu
*s)
{
for (;;) {
{
for (;;) {
- struct
rcu_lfs_node
*head;
+ struct
cds_lfs_node_rcu
*head;
rcu_read_lock();
head = rcu_dereference(s->head);
if (head) {
rcu_read_lock();
head = rcu_dereference(s->head);
if (head) {
- struct
rcu_lfs_node
*next = rcu_dereference(head->next);
+ struct
cds_lfs_node_rcu
*next = rcu_dereference(head->next);
if (uatomic_cmpxchg(&s->head, head, next) == head) {
rcu_read_unlock();
if (uatomic_cmpxchg(&s->head, head, next) == head) {
rcu_read_unlock();
This page took
0.027357 seconds
and
4
git commands to generate.