#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;
}
+static inline
void _cds_wfs_init(struct cds_wfs_stack *s)
{
int 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;
* 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.
*/
+static inline
struct cds_wfs_node *
___cds_wfs_pop_blocking(struct cds_wfs_stack *s)
{
goto retry; /* Concurrent modification. Retry. */
}
+static inline
struct cds_wfs_node *
_cds_wfs_pop_blocking(struct cds_wfs_stack *s)
{