Revert "Create per RCU flavor CDS libraries"
[urcu.git] / urcu / static / rculfstack.h
index 1df121b461389fbb0b621e6eeefb37c4b4e131eb..3473ccef82299b0b41559734e75377b2ac0f1941 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #include <urcu/uatomic.h>
+#include <urcu-pointer.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -90,7 +91,7 @@ int _cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s,
 }
 
 /*
- * Acts as a RCU reader.
+ * Should be called under rcu read-side lock.
  *
  * The caller must wait for a grace period to pass before freeing the returned
  * node or modifying the cds_lfs_node_rcu structure.
@@ -103,22 +104,18 @@ _cds_lfs_pop_rcu(struct cds_lfs_stack_rcu *s)
        for (;;) {
                struct cds_lfs_node_rcu *head;
 
-               rcu_read_lock();
                head = rcu_dereference(s->head);
                if (head) {
                        struct cds_lfs_node_rcu *next = rcu_dereference(head->next);
 
                        if (uatomic_cmpxchg(&s->head, head, next) == head) {
-                               rcu_read_unlock();
                                return head;
                        } else {
                                /* Concurrent modification. Retry. */
-                               rcu_read_unlock();
                                continue;
                        }
                } else {
                        /* Empty stack */
-                       rcu_read_unlock();
                        return NULL;
                }
        }
This page took 0.02465 seconds and 4 git commands to generate.