/* 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();
}
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;
unsigned long long *count = _count;
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();
*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);
}
unsigned long long *count = _count;
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();
}
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);
}
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());
tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
tid_writer = malloc(sizeof(*tid_writer) * nr_writers);