projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup: all functions have declarations (-Wmissing-prototypes)
[urcu.git]
/
tests
/
benchmark
/
test_perthreadlock.c
diff --git
a/tests/benchmark/test_perthreadlock.c
b/tests/benchmark/test_perthreadlock.c
index 512b1fc8ff1dc1f6697c28911ce382cec3c1ebe3..ac21444191d55092c43474d7a405e9c3a4d072c1 100644
(file)
--- a/
tests/benchmark/test_perthreadlock.c
+++ b/
tests/benchmark/test_perthreadlock.c
@@
-33,7
+33,6
@@
#include <urcu/arch.h>
#include <urcu/tls-compat.h>
#include <urcu/arch.h>
#include <urcu/tls-compat.h>
-#include "cpuset.h"
#include "thread-id.h"
/* hardcoded number of CPUs */
#include "thread-id.h"
/* hardcoded number of CPUs */
@@
-114,11
+113,7
@@
static void set_affinity(void)
}
CPU_ZERO(&mask);
CPU_SET(cpu, &mask);
}
CPU_ZERO(&mask);
CPU_SET(cpu, &mask);
-#if SCHED_SETAFFINITY_ARGS == 2
- sched_setaffinity(0, &mask);
-#else
sched_setaffinity(0, sizeof(mask), &mask);
sched_setaffinity(0, sizeof(mask), &mask);
-#endif
#endif /* HAVE_SCHED_SETAFFINITY */
}
#endif /* HAVE_SCHED_SETAFFINITY */
}
@@
-170,6
+165,7
@@
static void urcu_mutex_unlock(pthread_mutex_t *lock)
}
}
}
}
+static
void *thr_reader(void *data)
{
unsigned long tidx = (unsigned long)data;
void *thr_reader(void *data)
{
unsigned long tidx = (unsigned long)data;
@@
-204,6
+200,7
@@
void *thr_reader(void *data)
}
}
+static
void *thr_writer(void *data)
{
unsigned long wtidx = (unsigned long)data;
void *thr_writer(void *data)
{
unsigned long wtidx = (unsigned long)data;
@@
-220,7
+217,7
@@
void *thr_writer(void *data)
cmm_smp_mb();
for (;;) {
cmm_smp_mb();
for (;;) {
- for (tidx = 0; tidx < nr_readers; tidx++) {
+ for (tidx = 0; tidx <
(long)
nr_readers; tidx++) {
urcu_mutex_lock(&per_thread_lock[tidx].lock);
}
test_array.a = 0;
urcu_mutex_lock(&per_thread_lock[tidx].lock);
}
test_array.a = 0;
@@
-243,6
+240,7
@@
void *thr_writer(void *data)
return ((void*)2);
}
return ((void*)2);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
This page took
0.024374 seconds
and
4
git commands to generate.