projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update return value of "set" operations
[urcu.git]
/
urcu
/
static
/
wfstack.h
diff --git
a/urcu/static/wfstack.h
b/urcu/static/wfstack.h
index ff18c4a3f213214188ef6bfe6f6c98a795132bab..cb68a59a16d8dc270355d1b6b29506d2120c812f 100644
(file)
--- a/
urcu/static/wfstack.h
+++ b/
urcu/static/wfstack.h
@@
-30,7
+30,7
@@
#include <assert.h>
#include <poll.h>
#include <urcu/compiler.h>
#include <assert.h>
#include <poll.h>
#include <urcu/compiler.h>
-#include <urcu/uatomic
_arch
.h>
+#include <urcu/uatomic.h>
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
@@
-40,11
+40,13
@@
extern "C" {
#define CDS_WFS_ADAPT_ATTEMPTS 10 /* Retry if being set */
#define CDS_WFS_WAIT 10 /* Wait 10 ms if being set */
#define CDS_WFS_ADAPT_ATTEMPTS 10 /* Retry if being set */
#define CDS_WFS_WAIT 10 /* Wait 10 ms if being set */
+static inline
void _cds_wfs_node_init(struct cds_wfs_node *node)
{
node->next = NULL;
}
void _cds_wfs_node_init(struct cds_wfs_node *node)
{
node->next = NULL;
}
+static inline
void _cds_wfs_init(struct cds_wfs_stack *s)
{
int ret;
void _cds_wfs_init(struct cds_wfs_stack *s)
{
int ret;
@@
-54,7
+56,11
@@
void _cds_wfs_init(struct cds_wfs_stack *s)
assert(!ret);
}
assert(!ret);
}
-void _cds_wfs_push(struct cds_wfs_stack *s, struct cds_wfs_node *node)
+/*
+ * Returns 0 if stack was empty, 1 otherwise.
+ */
+static inline
+int _cds_wfs_push(struct cds_wfs_stack *s, struct cds_wfs_node *node)
{
struct cds_wfs_node *old_head;
{
struct cds_wfs_node *old_head;
@@
-69,11
+75,13
@@
void _cds_wfs_push(struct cds_wfs_stack *s, struct cds_wfs_node *node)
* until node->next is set to old_head.
*/
CMM_STORE_SHARED(node->next, old_head);
* until node->next is set to old_head.
*/
CMM_STORE_SHARED(node->next, old_head);
+ return (old_head != CDS_WF_STACK_END);
}
/*
* Returns NULL if stack is empty.
*/
}
/*
* Returns NULL if stack is empty.
*/
+static inline
struct cds_wfs_node *
___cds_wfs_pop_blocking(struct cds_wfs_stack *s)
{
struct cds_wfs_node *
___cds_wfs_pop_blocking(struct cds_wfs_stack *s)
{
@@
-100,6
+108,7
@@
retry:
goto retry; /* Concurrent modification. Retry. */
}
goto retry; /* Concurrent modification. Retry. */
}
+static inline
struct cds_wfs_node *
_cds_wfs_pop_blocking(struct cds_wfs_stack *s)
{
struct cds_wfs_node *
_cds_wfs_pop_blocking(struct cds_wfs_stack *s)
{
This page took
0.023382 seconds
and
4
git commands to generate.