X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_qsbr.c;h=da26b77329cf11f2a6629643054d4947947dbfa7;hb=6ff854acfa013195bdb71dddc654ec76a4c296c9;hp=7f27038d2fbf8455f84aa25915698b818ed33088;hpb=95bc7fb90c36ee10dc171a23e8783eff30072b7b;p=userspace-rcu.git diff --git a/tests/test_urcu_qsbr.c b/tests/test_urcu_qsbr.c index 7f27038..da26b77 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" @@ -223,7 +223,8 @@ void *thr_reader(void *_count) struct test_array *local_ptr; printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", - "reader", pthread_self(), (unsigned long)gettid()); + "reader", (unsigned long) pthread_self(), + (unsigned long) gettid()); set_affinity(); @@ -237,7 +238,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)) @@ -259,7 +260,8 @@ void *thr_reader(void *_count) *count = URCU_TLS(nr_reads); printf_verbose("thread_end %s, thread id : %lx, tid %lu\n", - "reader", pthread_self(), (unsigned long)gettid()); + "reader", (unsigned long) pthread_self(), + (unsigned long) gettid()); return ((void*)1); } @@ -270,7 +272,8 @@ void *thr_writer(void *_count) struct test_array *new, *old; printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", - "writer", pthread_self(), (unsigned long)gettid()); + "writer", (unsigned long) pthread_self(), + (unsigned long) gettid()); set_affinity(); @@ -300,7 +303,8 @@ void *thr_writer(void *_count) } printf_verbose("thread_end %s, thread id : %lx, tid %lu\n", - "writer", pthread_self(), (unsigned long)gettid()); + "writer", (unsigned long) pthread_self(), + (unsigned long) gettid()); *count = URCU_TLS(nr_writes); return ((void*)2); } @@ -357,10 +361,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': @@ -405,7 +409,8 @@ int main(int argc, char **argv) printf_verbose("Writer delay : %lu loops.\n", wdelay); printf_verbose("Reader duration : %lu loops.\n", rduration); printf_verbose("thread %-6s, thread id : %lx, tid %lu\n", - "main", pthread_self(), (unsigned long)gettid()); + "main", (unsigned long) pthread_self(), + (unsigned long) gettid()); test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE); tid_reader = malloc(sizeof(*tid_reader) * nr_readers);