X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu%2Fstatic%2Furcu-qsbr.h;h=8f2ca32a2f111c4b1469c010c5f1fcb4669039a5;hp=ef1f600d6c2248d3b1320b2056ef49b661660873;hb=2650042a5405028da49bfcfb71053b78a56a9ed4;hpb=15302e2854ad9f1377ec81e331c1bec7a54a5621 diff --git a/urcu/static/urcu-qsbr.h b/urcu/static/urcu-qsbr.h index ef1f600..8f2ca32 100644 --- a/urcu/static/urcu-qsbr.h +++ b/urcu/static/urcu-qsbr.h @@ -68,58 +68,10 @@ enum rcu_state { RCU_READER_INACTIVE, }; -#ifdef DEBUG_YIELD -#include -#include -#include -#include - -#define RCU_YIELD_READ (1 << 0) -#define RCU_YIELD_WRITE (1 << 1) - -/* maximum sleep delay, in us */ -#define MAX_SLEEP 50 - -extern unsigned int rcu_yield_active; -extern DECLARE_URCU_TLS(unsigned int, rcu_rand_yield); - -static inline void rcu_debug_yield_read(void) -{ - if (rcu_yield_active & RCU_YIELD_READ) - if (rand_r(&URCU_TLS(rcu_rand_yield)) & 0x1) - usleep(rand_r(&URCU_TLS(rcu_rand_yield)) % MAX_SLEEP); -} - -static inline void rcu_debug_yield_write(void) -{ - if (rcu_yield_active & RCU_YIELD_WRITE) - if (rand_r(&URCU_TLS(rcu_rand_yield)) & 0x1) - usleep(rand_r(&URCU_TLS(rcu_rand_yield)) % MAX_SLEEP); -} - -static inline void rcu_debug_yield_init(void) -{ - URCU_TLS(rcu_rand_yield) = time(NULL) ^ (unsigned long) pthread_self(); -} -#else -static inline void rcu_debug_yield_read(void) -{ -} - -static inline void rcu_debug_yield_write(void) -{ -} - -static inline void rcu_debug_yield_init(void) -{ - -} -#endif - #define RCU_GP_ONLINE (1UL << 0) #define RCU_GP_CTR (1UL << 1) -struct urcu_gp { +struct rcu_gp { /* * Global quiescent period counter with low-order bits unused. * Using a int rather than a char to eliminate false register @@ -130,7 +82,7 @@ struct urcu_gp { int32_t futex; } __attribute__((aligned(CAA_CACHE_LINE_SIZE))); -extern struct urcu_gp rcu_gp; +extern struct rcu_gp rcu_gp; struct rcu_reader { /* Data used by both reader and synchronize_rcu() */