X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Ftest_urcu_lfq.c;h=2291f4fa827eb67bf7a605330c8fe6d00733ecd0;hp=ec5d822d1b1dde350af55b99fd8dd009bed5c293;hb=372b9ad7acc40810bbcec6a796c71b54901b3ca7;hpb=eb856b57d2c2cfe63468a85b55313cc6d460b855 diff --git a/tests/test_urcu_lfq.c b/tests/test_urcu_lfq.c index ec5d822..2291f4f 100644 --- a/tests/test_urcu_lfq.c +++ b/tests/test_urcu_lfq.c @@ -105,9 +105,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; @@ -169,7 +170,8 @@ void *thr_enqueuer(void *_count) unsigned long long *count = _count; printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", - "enqueuer", pthread_self(), (unsigned long)gettid()); + "enqueuer", (unsigned long) pthread_self(), + (unsigned long) gettid()); set_affinity(); @@ -204,7 +206,8 @@ fail: count[1] = URCU_TLS(nr_successful_enqueues); printf_verbose("enqueuer thread_end, thread id : %lx, tid %lu, " "enqueues %llu successful_enqueues %llu\n", - pthread_self(), (unsigned long)gettid(), + pthread_self(), + (unsigned long) gettid(), URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues)); return ((void*)1); @@ -223,7 +226,8 @@ void *thr_dequeuer(void *_count) unsigned long long *count = _count; printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", - "dequeuer", pthread_self(), (unsigned long)gettid()); + "dequeuer", (unsigned long) pthread_self(), + (unsigned long) gettid()); set_affinity(); @@ -259,7 +263,8 @@ void *thr_dequeuer(void *_count) rcu_unregister_thread(); printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, " "dequeues %llu, successful_dequeues %llu\n", - pthread_self(), (unsigned long)gettid(), + pthread_self(), + (unsigned long) gettid(), URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues)); count[0] = URCU_TLS(nr_dequeues); count[1] = URCU_TLS(nr_successful_dequeues); @@ -367,7 +372,8 @@ int main(int argc, char **argv) printf_verbose("Writer delay : %lu loops.\n", rduration); printf_verbose("Reader duration : %lu loops.\n", wdelay); printf_verbose("thread %-6s, thread id : %lx, tid %lu\n", - "main", pthread_self(), (unsigned long)gettid()); + "main", (unsigned long) pthread_self(), + (unsigned long) gettid()); tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers); tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);