projects
/
userspace-rcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lfstack: introduce CDS_LFS_END define
[userspace-rcu.git]
/
urcu
/
static
/
lfstack.h
diff --git
a/urcu/static/lfstack.h
b/urcu/static/lfstack.h
index 63af91adf301918b0331eb3cf55c0c52c5f9711f..9531de5bb951f31c47bfc51ef2f8ff9a343cc0fc 100644
(file)
--- a/
urcu/static/lfstack.h
+++ b/
urcu/static/lfstack.h
@@
-36,6
+36,8
@@
extern "C" {
#endif
extern "C" {
#endif
+#define CDS_LFS_END NULL
+
/*
* Lock-free stack.
*
/*
* Lock-free stack.
*
@@
-73,7
+75,7
@@
void _cds_lfs_init(struct cds_lfs_stack *s)
{
int ret;
{
int ret;
- s->head =
NULL
;
+ s->head =
CDS_LFS_END
;
ret = pthread_mutex_init(&s->lock, NULL);
assert(!ret);
}
ret = pthread_mutex_init(&s->lock, NULL);
assert(!ret);
}
@@
-84,13
+86,13
@@
void _cds_lfs_init(struct cds_lfs_stack *s)
static inline
void ___cds_lfs_init(struct __cds_lfs_stack *s)
{
static inline
void ___cds_lfs_init(struct __cds_lfs_stack *s)
{
- s->head =
NULL
;
+ s->head =
CDS_LFS_END
;
}
static inline
bool ___cds_lfs_empty_head(struct cds_lfs_head *head)
{
}
static inline
bool ___cds_lfs_empty_head(struct cds_lfs_head *head)
{
- return head ==
NULL
;
+ return head ==
CDS_LFS_END
;
}
/*
}
/*
@@
-138,7
+140,7
@@
bool _cds_lfs_push(cds_lfs_stack_ptr_t u_s,
struct cds_lfs_node *node)
{
struct __cds_lfs_stack *s = u_s._s;
struct cds_lfs_node *node)
{
struct __cds_lfs_stack *s = u_s._s;
- struct cds_lfs_head *head =
NULL
;
+ struct cds_lfs_head *head =
CDS_LFS_END
;
struct cds_lfs_head *new_head =
caa_container_of(node, struct cds_lfs_head, node);
struct cds_lfs_head *new_head =
caa_container_of(node, struct cds_lfs_head, node);
@@
-237,7
+239,7
@@
struct cds_lfs_head *___cds_lfs_pop_all(cds_lfs_stack_ptr_t u_s)
* taking care to order writes to each node prior to the full
* memory barrier after this uatomic_xchg().
*/
* taking care to order writes to each node prior to the full
* memory barrier after this uatomic_xchg().
*/
- return uatomic_xchg(&s->head,
NULL
);
+ return uatomic_xchg(&s->head,
CDS_LFS_END
);
}
/*
}
/*
This page took
0.024214 seconds
and
4
git commands to generate.