projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests/regression/rcutorture: Add wait state
[urcu.git]
/
tests
/
benchmark
/
test_perthreadlock.c
diff --git
a/tests/benchmark/test_perthreadlock.c
b/tests/benchmark/test_perthreadlock.c
index ac21444191d55092c43474d7a405e9c3a4d072c1..47a512cba06b12d8672247710db5feabdd2e3c45 100644
(file)
--- a/
tests/benchmark/test_perthreadlock.c
+++ b/
tests/benchmark/test_perthreadlock.c
@@
-28,10
+28,10
@@
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
-#include <assert.h>
#include <errno.h>
#include <urcu/arch.h>
#include <errno.h>
#include <urcu/arch.h>
+#include <urcu/assert.h>
#include <urcu/tls-compat.h>
#include "thread-id.h"
#include <urcu/tls-compat.h>
#include "thread-id.h"
@@
-89,7
+89,7
@@
pthread_mutex_t affinity_mutex = PTHREAD_MUTEX_INITIALIZER;
static void set_affinity(void)
{
static void set_affinity(void)
{
-#if HAVE_SCHED_SETAFFINITY
+#if
def
HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
int cpu, ret;
#endif /* HAVE_SCHED_SETAFFINITY */
cpu_set_t mask;
int cpu, ret;
#endif /* HAVE_SCHED_SETAFFINITY */
@@
-97,7
+97,7
@@
static void set_affinity(void)
if (!use_affinity)
return;
if (!use_affinity)
return;
-#if HAVE_SCHED_SETAFFINITY
+#if
def
HAVE_SCHED_SETAFFINITY
ret = pthread_mutex_lock(&affinity_mutex);
if (ret) {
errno = ret;
ret = pthread_mutex_lock(&affinity_mutex);
if (ret) {
errno = ret;
@@
-184,7
+184,7
@@
void *thr_reader(void *data)
urcu_mutex_lock(&per_thread_lock[tidx].lock);
v = test_array.a;
urcu_mutex_lock(&per_thread_lock[tidx].lock);
v = test_array.a;
- assert(v == 8);
+
urcu_posix_
assert(v == 8);
if (caa_unlikely(rduration))
loop_sleep(rduration);
urcu_mutex_unlock(&per_thread_lock[tidx].lock);
if (caa_unlikely(rduration))
loop_sleep(rduration);
urcu_mutex_unlock(&per_thread_lock[tidx].lock);
@@
-241,7
+241,7
@@
void *thr_writer(void *data)
}
static
}
static
-void show_usage(
int argc,
char **argv)
+void show_usage(char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
argv[0]);
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
argv[0]);
@@
-264,26
+264,26
@@
int main(int argc, char **argv)
unsigned int i_thr;
if (argc < 4) {
unsigned int i_thr;
if (argc < 4) {
- show_usage(arg
c, arg
v);
+ show_usage(argv);
return -1;
}
cmm_smp_mb();
err = sscanf(argv[1], "%u", &nr_readers);
if (err != 1) {
return -1;
}
cmm_smp_mb();
err = sscanf(argv[1], "%u", &nr_readers);
if (err != 1) {
- show_usage(arg
c, arg
v);
+ show_usage(argv);
return -1;
}
err = sscanf(argv[2], "%u", &nr_writers);
if (err != 1) {
return -1;
}
err = sscanf(argv[2], "%u", &nr_writers);
if (err != 1) {
- show_usage(arg
c, arg
v);
+ show_usage(argv);
return -1;
}
err = sscanf(argv[3], "%lu", &duration);
if (err != 1) {
return -1;
}
err = sscanf(argv[3], "%lu", &duration);
if (err != 1) {
- show_usage(arg
c, arg
v);
+ show_usage(argv);
return -1;
}
return -1;
}
@@
-293,7
+293,7
@@
int main(int argc, char **argv)
switch (argv[i][1]) {
case 'a':
if (argc < i + 2) {
switch (argv[i][1]) {
case 'a':
if (argc < i + 2) {
- show_usage(arg
c, arg
v);
+ show_usage(argv);
return -1;
}
a = atoi(argv[++i]);
return -1;
}
a = atoi(argv[++i]);
@@
-303,21
+303,21
@@
int main(int argc, char **argv)
break;
case 'c':
if (argc < i + 2) {
break;
case 'c':
if (argc < i + 2) {
- show_usage(arg
c, arg
v);
+ show_usage(argv);
return -1;
}
rduration = atol(argv[++i]);
break;
case 'd':
if (argc < i + 2) {
return -1;
}
rduration = atol(argv[++i]);
break;
case 'd':
if (argc < i + 2) {
- show_usage(arg
c, arg
v);
+ show_usage(argv);
return -1;
}
wdelay = atol(argv[++i]);
break;
case 'e':
if (argc < i + 2) {
return -1;
}
wdelay = atol(argv[++i]);
break;
case 'e':
if (argc < i + 2) {
- show_usage(arg
c, arg
v);
+ show_usage(argv);
return -1;
}
wduration = atol(argv[++i]);
return -1;
}
wduration = atol(argv[++i]);
This page took
0.026314 seconds
and
4
git commands to generate.