extern "C" {
#endif
+#define CDS_LFS_END NULL
+
/*
* Lock-free stack.
*
{
int ret;
- s->head = NULL;
+ s->head = CDS_LFS_END;
ret = pthread_mutex_init(&s->lock, NULL);
assert(!ret);
}
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)
{
- return head == NULL;
+ return head == CDS_LFS_END;
}
/*
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);
* 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);
}
/*