X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu.c;h=c42184656a3a0381b518aa15372b84a365400dea;hp=a5178c0054bea5f0363b571d542b98b4d6803f9e;hb=1de4df4b770e5e90440008becc5e14a15c75c6e0;hpb=4a6d73787de534cbd7d5fc7a6b60af64de66e7ea diff --git a/urcu.c b/urcu.c index a5178c0..c421846 100644 --- a/urcu.c +++ b/urcu.c @@ -36,7 +36,7 @@ #include #include -#include "urcu/wfqueue.h" +#include "urcu/wfcqueue.h" #include "urcu/map/urcu.h" #include "urcu/static/urcu.h" #include "urcu-pointer.h" @@ -63,7 +63,7 @@ #ifdef RCU_MEMBARRIER static int init_done; -int has_sys_membarrier; +int rcu_has_sys_membarrier; void __attribute__((constructor)) rcu_init(void); #endif @@ -83,7 +83,7 @@ void __attribute__((destructor)) rcu_exit(void); static pthread_mutex_t rcu_gp_lock = PTHREAD_MUTEX_INITIALIZER; -int32_t gp_futex; +int32_t rcu_gp_futex; /* * Global grace period counter. @@ -100,8 +100,8 @@ unsigned long rcu_gp_ctr = RCU_GP_COUNT; DEFINE_URCU_TLS(struct rcu_reader, rcu_reader); #ifdef DEBUG_YIELD -unsigned int yield_active; -DEFINE_URCU_TLS(unsigned int, rand_yield); +unsigned int rcu_yield_active; +DEFINE_URCU_TLS(unsigned int, rcu_rand_yield); #endif static CDS_LIST_HEAD(registry); @@ -140,7 +140,7 @@ static void mutex_unlock(pthread_mutex_t *mutex) #ifdef RCU_MEMBARRIER static void smp_mb_master(int group) { - if (caa_likely(has_sys_membarrier)) + if (caa_likely(rcu_has_sys_membarrier)) membarrier(MEMBARRIER_EXPEDITED); else cmm_smp_mb(); @@ -210,12 +210,12 @@ static void wait_gp(void) { /* Read reader_gp before read futex */ smp_mb_master(RCU_MB_GROUP); - if (uatomic_read(&gp_futex) == -1) - futex_async(&gp_futex, FUTEX_WAIT, -1, + if (uatomic_read(&rcu_gp_futex) == -1) + futex_async(&rcu_gp_futex, FUTEX_WAIT, -1, NULL, NULL, 0); } -void update_counter_and_wait(void) +static void update_counter_and_wait(void) { CDS_LIST_HEAD(qsreaders); int wait_loops = 0; @@ -246,7 +246,7 @@ void update_counter_and_wait(void) for (;;) { wait_loops++; if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) { - uatomic_dec(&gp_futex); + uatomic_dec(&rcu_gp_futex); /* Write futex before read reader_gp */ smp_mb_master(RCU_MB_GROUP); } @@ -261,7 +261,7 @@ void update_counter_and_wait(void) if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) { /* Read reader_gp before write futex */ smp_mb_master(RCU_MB_GROUP); - uatomic_set(&gp_futex, 0); + uatomic_set(&rcu_gp_futex, 0); } break; } else { @@ -280,7 +280,7 @@ void update_counter_and_wait(void) if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) { /* Read reader_gp before write futex */ smp_mb_master(RCU_MB_GROUP); - uatomic_set(&gp_futex, 0); + uatomic_set(&rcu_gp_futex, 0); } break; } else { @@ -389,7 +389,7 @@ void rcu_init(void) return; init_done = 1; if (!membarrier(MEMBARRIER_EXPEDITED | MEMBARRIER_QUERY)) - has_sys_membarrier = 1; + rcu_has_sys_membarrier = 1; } #endif