assert(!ret);
}
+/*
+ * Returns 0 if stack was empty, 1 otherwise.
+ */
static inline
-void _cds_wfs_push(struct cds_wfs_stack *s, struct cds_wfs_node *node)
+int _cds_wfs_push(struct cds_wfs_stack *s, struct cds_wfs_node *node)
{
struct cds_wfs_node *old_head;
* until node->next is set to old_head.
*/
CMM_STORE_SHARED(node->next, old_head);
+ return (old_head != CDS_WF_STACK_END);
}
/*
extern void cds_wfs_node_init(struct cds_wfs_node *node);
extern void cds_wfs_init(struct cds_wfs_stack *s);
-extern void cds_wfs_push(struct cds_wfs_stack *s, struct cds_wfs_node *node);
+extern int cds_wfs_push(struct cds_wfs_stack *s, struct cds_wfs_node *node);
/* __cds_wfs_pop_blocking: caller ensures mutual exclusion between pops */
extern struct cds_wfs_node *__cds_wfs_pop_blocking(struct cds_wfs_stack *s);
extern struct cds_wfs_node *cds_wfs_pop_blocking(struct cds_wfs_stack *s);
_cds_wfs_init(s);
}
-void cds_wfs_push(struct cds_wfs_stack *s, struct cds_wfs_node *node)
+int cds_wfs_push(struct cds_wfs_stack *s, struct cds_wfs_node *node)
{
- _cds_wfs_push(s, node);
+ return _cds_wfs_push(s, node);
}
struct cds_wfs_node *__cds_wfs_pop_blocking(struct cds_wfs_stack *s)