fix: shadowed local variable (-Wshadow)
[urcu.git] / tests / benchmark / test_urcu_qsbr_gc.c
index 11f0359fac1be97158b4bc8a40775d7a08c5f172..eacdf2ee5ebd848556fc45d41291b5c06caa6d0a 100644 (file)
@@ -33,7 +33,6 @@
 
 #include <urcu/arch.h>
 #include <urcu/tls-compat.h>
-#include "cpuset.h"
 #include "thread-id.h"
 #include "../common/debug-yield.h"
 
@@ -57,7 +56,7 @@ static unsigned long duration;
 
 /* read-side C.S. duration, in loops */
 static unsigned long rduration;
-static unsigned int reclaim_batch = 1;
+static long reclaim_batch = 1;
 
 struct reclaim_queue {
        void **queue;   /* Beginning of queue */
@@ -115,11 +114,7 @@ static void set_affinity(void)
 
        CPU_ZERO(&mask);
        CPU_SET(cpu, &mask);
-#if SCHED_SETAFFINITY_ARGS == 2
-       sched_setaffinity(0, &mask);
-#else
        sched_setaffinity(0, sizeof(mask), &mask);
-#endif
 #endif /* HAVE_SCHED_SETAFFINITY */
 }
 
@@ -146,28 +141,7 @@ pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
 static
 unsigned long long __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *tot_nr_writes;
 
-
-void rcu_copy_mutex_lock(void)
-{
-       int ret;
-       ret = pthread_mutex_lock(&rcu_copy_mutex);
-       if (ret) {
-               perror("Error in pthread mutex lock");
-               exit(-1);
-       }
-}
-
-void rcu_copy_mutex_unlock(void)
-{
-       int ret;
-
-       ret = pthread_mutex_unlock(&rcu_copy_mutex);
-       if (ret) {
-               perror("Error in pthread mutex unlock");
-               exit(-1);
-       }
-}
-
+static
 void *thr_reader(void *_count)
 {
        unsigned long long *count = _count;
@@ -242,6 +216,7 @@ static void rcu_gc_reclaim(unsigned long wtidx, void *old)
        rcu_gc_clear_queue(wtidx);
 }
 
+static
 void *thr_writer(void *data)
 {
        unsigned long wtidx = (unsigned long)data;
@@ -283,6 +258,7 @@ void *thr_writer(void *data)
        return ((void*)2);
 }
 
+static
 void show_usage(int argc, char **argv)
 {
        printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
@@ -450,7 +426,7 @@ int main(int argc, char **argv)
        printf("SUMMARY %-25s testdur %4lu nr_readers %3u rdur %6lu wdur %6lu "
                "nr_writers %3u "
                "wdelay %6lu nr_reads %12llu nr_writes %12llu nr_ops %12llu "
-               "batch %u\n",
+               "batch %ld\n",
                argv[0], duration, nr_readers, rduration, wduration,
                nr_writers, wdelay, tot_reads, tot_writes,
                tot_reads + tot_writes, reclaim_batch);
This page took 0.023979 seconds and 4 git commands to generate.