summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b194c06)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
-void cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s, struct cds_lfs_node_rcu *node)
+int cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s,
+ struct cds_lfs_node_rcu *node)
- _cds_lfs_push_rcu(s, node);
+ return _cds_lfs_push_rcu(s, node);
}
struct cds_lfs_node_rcu *cds_lfs_pop_rcu(struct cds_lfs_stack_rcu *s)
}
struct cds_lfs_node_rcu *cds_lfs_pop_rcu(struct cds_lfs_stack_rcu *s)
extern void cds_lfs_node_init_rcu(struct cds_lfs_node_rcu *node);
extern void cds_lfs_init_rcu(struct cds_lfs_stack_rcu *s);
extern void cds_lfs_node_init_rcu(struct cds_lfs_node_rcu *node);
extern void cds_lfs_init_rcu(struct cds_lfs_stack_rcu *s);
-extern void cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s, struct cds_lfs_node_rcu *node);
+extern int cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s,
+ struct cds_lfs_node_rcu *node);
/*
* Acts as a RCU reader.
/*
* Acts as a RCU reader.
* required if we first read the old head value). This design decision
* might be revisited after more throrough benchmarking on various
* platforms.
* required if we first read the old head value). This design decision
* might be revisited after more throrough benchmarking on various
* platforms.
+ *
+ * Returns 0 if the stack was empty prior to adding the node.
+ * Returns non-zero otherwise.
-void _cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s, struct cds_lfs_node_rcu *node)
+int _cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s,
+ struct cds_lfs_node_rcu *node)
{
struct cds_lfs_node_rcu *head = NULL;
{
struct cds_lfs_node_rcu *head = NULL;
if (old_head == head)
break;
}
if (old_head == head)
break;
}
+ return (int) !!((unsigned long) head);