From 7ab587e26cf2474852b1f19189a958c31a5c6980 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 13 Jul 2010 17:12:49 -0400 Subject: [PATCH] RCU wait-free stack: add _blocking in pop() primitive name Signed-off-by: Mathieu Desnoyers --- tests/test_urcu_wfs.c | 4 ++-- urcu/rcuwfstack.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_urcu_wfs.c b/tests/test_urcu_wfs.c index 4802ee7..73655c1 100644 --- a/tests/test_urcu_wfs.c +++ b/tests/test_urcu_wfs.c @@ -218,7 +218,7 @@ void *thr_dequeuer(void *_count) smp_mb(); for (;;) { - struct rcu_wfs_node *node = rcu_wfs_pop(&s); + struct rcu_wfs_node *node = rcu_wfs_pop_blocking(&s); if (node) { defer_rcu(free, node); @@ -249,7 +249,7 @@ void test_end(struct rcu_wfs_stack *s, unsigned long long *nr_dequeues) struct rcu_wfs_node *node; do { - node = rcu_wfs_pop(s); + node = rcu_wfs_pop_blocking(s); if (node) { free(node); (*nr_dequeues)++; diff --git a/urcu/rcuwfstack.h b/urcu/rcuwfstack.h index f9a45b2..300c95e 100644 --- a/urcu/rcuwfstack.h +++ b/urcu/rcuwfstack.h @@ -29,7 +29,7 @@ #error "Dynamic loader LGPL wrappers not implemented yet" #endif -#define RCU_WF_STACK_END ((void *)0x1UL) +#define RCU_WF_STACK_END ((void *)0x1UL) struct rcu_wfs_node { struct rcu_wfs_node *next; @@ -83,7 +83,7 @@ void rcu_wfs_push(struct rcu_wfs_stack *s, struct rcu_wfs_node *node) * loops. Better for UP. */ struct rcu_wfs_node * -rcu_wfs_pop(struct rcu_wfs_stack *s) +rcu_wfs_pop_blocking(struct rcu_wfs_stack *s) { for (;;) { struct rcu_wfs_node *head; -- 2.34.1