projects
/
userspace-rcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make lf stack push return if the stack was empty
[userspace-rcu.git]
/
urcu
/
static
/
rculfstack.h
diff --git
a/urcu/static/rculfstack.h
b/urcu/static/rculfstack.h
index 9d69fa736996c4dfc704bbffc88d9f14395344c8..1df121b461389fbb0b621e6eeefb37c4b4e131eb 100644
(file)
--- a/
urcu/static/rculfstack.h
+++ b/
urcu/static/rculfstack.h
@@
-64,9
+64,13
@@
void _cds_lfs_init_rcu(struct cds_lfs_stack_rcu *s)
* 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.
*/
static inline
*/
static inline
-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;
@@
-82,6
+86,7
@@
void _cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s, struct cds_lfs_node_rcu *nod
if (old_head == head)
break;
}
if (old_head == head)
break;
}
+ return (int) !!((unsigned long) head);
}
/*
}
/*
This page took
0.023428 seconds
and
4
git commands to generate.