Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+#define CDS_LFS_END NULL
+
ret = pthread_mutex_init(&s->lock, NULL);
assert(!ret);
}
ret = pthread_mutex_init(&s->lock, NULL);
assert(!ret);
}
static inline
void ___cds_lfs_init(struct __cds_lfs_stack *s)
{
static inline
void ___cds_lfs_init(struct __cds_lfs_stack *s)
{
}
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 == CDS_LFS_END;
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);
* 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);