wfstack: push returns prior stack emptiness state
[urcu.git] / urcu / static / wfstack.h
index 79ed3f774446e042de152ed7c04a7a43cf5aa65b..cb68a59a16d8dc270355d1b6b29506d2120c812f 100644 (file)
@@ -56,8 +56,11 @@ void _cds_wfs_init(struct cds_wfs_stack *s)
        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;
 
@@ -72,6 +75,7 @@ void _cds_wfs_push(struct cds_wfs_stack *s, struct cds_wfs_node *node)
         * until node->next is set to old_head.
         */
        CMM_STORE_SHARED(node->next, old_head);
+       return (old_head != CDS_WF_STACK_END);
 }
 
 /*
This page took 0.023275 seconds and 4 git commands to generate.