X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu%2Fstatic%2Frculfstack.h;h=4259e0c00bb9e821568b3720c0d46fe8d23ea8ca;hp=1df121b461389fbb0b621e6eeefb37c4b4e131eb;hb=6e5f88cf94a225b155719046d87bfd32ba47e06a;hpb=dc53e23e90262674fe23889bf1cea28b27288837 diff --git a/urcu/static/rculfstack.h b/urcu/static/rculfstack.h index 1df121b..4259e0c 100644 --- a/urcu/static/rculfstack.h +++ b/urcu/static/rculfstack.h @@ -90,7 +90,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 +103,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; } }