X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Ftest_urcu_qsbr.c;h=2e3e44628ce9a2e9bab460ff3fb318d70df653c8;hb=1de4df4b770e5e90440008becc5e14a15c75c6e0;hp=421fb0739bd8f665d22f25bf9f04a607776ecbf2;hpb=bd252a04bbbb163aa4d8864b1e1e5a3a4d9d0892;p=urcu.git diff --git a/tests/test_urcu_qsbr.c b/tests/test_urcu_qsbr.c index 421fb07..2e3e446 100644 --- a/tests/test_urcu_qsbr.c +++ b/tests/test_urcu_qsbr.c @@ -62,7 +62,7 @@ static inline pid_t gettid(void) #ifndef DYNAMIC_LINK_TEST #define _LGPL_SOURCE #else -#define debug_yield_read() +#define rcu_debug_yield_read() #endif #include "urcu-qsbr.h" @@ -84,9 +84,9 @@ static unsigned long rduration; /* write-side C.S. duration, in loops */ static unsigned long wduration; -static inline void loop_sleep(unsigned long l) +static inline void loop_sleep(unsigned long loops) { - while(l-- != 0) + while (loops-- != 0) caa_cpu_relax(); } @@ -112,9 +112,10 @@ typedef unsigned long cpu_set_t; static void set_affinity(void) { +#if HAVE_SCHED_SETAFFINITY cpu_set_t mask; - int cpu; - int ret; + int cpu, ret; +#endif /* HAVE_SCHED_SETAFFINITY */ if (!use_affinity) return; @@ -236,7 +237,7 @@ void *thr_reader(void *_count) for (;;) { rcu_read_lock(); local_ptr = rcu_dereference(test_rcu_pointer); - debug_yield_read(); + rcu_debug_yield_read(); if (local_ptr) assert(local_ptr->a == 8); if (caa_unlikely(rduration)) @@ -356,10 +357,10 @@ int main(int argc, char **argv) switch (argv[i][1]) { #ifdef DEBUG_YIELD case 'r': - yield_active |= YIELD_READ; + rcu_yield_active |= RCU_RCU_YIELD_READ; break; case 'w': - yield_active |= YIELD_WRITE; + rcu_yield_active |= RCU_RCU_YIELD_WRITE; break; #endif case 'a':