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_mutex.c
diff --git
a/tests/benchmark/test_mutex.c
b/tests/benchmark/test_mutex.c
index 8da8b0428d8d8ec7b0e6899be26702f8d7d857c8..55f7c38f21bf66f2d8ad7dbb91cb778256b6ccb4 100644
(file)
--- a/
tests/benchmark/test_mutex.c
+++ b/
tests/benchmark/test_mutex.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"
@@
-85,7
+85,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 */
@@
-93,7
+93,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) {
perror("Error in pthread mutex lock");
ret = pthread_mutex_lock(&affinity_mutex);
if (ret) {
perror("Error in pthread mutex lock");
@@
-156,7
+156,7
@@
void *thr_reader(void *data)
pthread_mutex_lock(&lock);
v = test_array.a;
pthread_mutex_lock(&lock);
v = test_array.a;
- assert(v == 8);
+
urcu_posix_
assert(v == 8);
if (caa_unlikely(rduration))
loop_sleep(rduration);
pthread_mutex_unlock(&lock);
if (caa_unlikely(rduration))
loop_sleep(rduration);
pthread_mutex_unlock(&lock);
@@
-208,7
+208,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]);
@@
-232,26
+232,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;
}
@@
-261,7
+261,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]);
@@
-271,21
+271,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.025492 seconds
and
4
git commands to generate.