projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: shadowed local variable (-Wshadow)
[urcu.git]
/
tests
/
benchmark
/
test_urcu_hash.c
diff --git
a/tests/benchmark/test_urcu_hash.c
b/tests/benchmark/test_urcu_hash.c
index 376f3b15075063653c1995d9eab1a690c28c7ccf..d7e09b325f58f5b3641bb2e5354b8b82f58d63d9 100644
(file)
--- a/
tests/benchmark/test_urcu_hash.c
+++ b/
tests/benchmark/test_urcu_hash.c
@@
-56,26
+56,31
@@
struct test_hash_cb test_hash_cb[] = {
static enum test_hash test_choice = TEST_HASH_RW;
static enum test_hash test_choice = TEST_HASH_RW;
+static
void (*get_sigusr1_cb(void))(int)
{
return test_hash_cb[test_choice].sigusr1;
}
void (*get_sigusr1_cb(void))(int)
{
return test_hash_cb[test_choice].sigusr1;
}
+static
void (*get_sigusr2_cb(void))(int)
{
return test_hash_cb[test_choice].sigusr2;
}
void (*get_sigusr2_cb(void))(int)
{
return test_hash_cb[test_choice].sigusr2;
}
+static
void *(*get_thr_reader_cb(void))(void *)
{
return test_hash_cb[test_choice].thr_reader;
}
void *(*get_thr_reader_cb(void))(void *)
{
return test_hash_cb[test_choice].thr_reader;
}
+static
void *(*get_thr_writer_cb(void))(void *)
{
return test_hash_cb[test_choice].thr_writer;
}
void *(*get_thr_writer_cb(void))(void *)
{
return test_hash_cb[test_choice].thr_writer;
}
+static
int (*get_populate_hash_cb(void))(void)
{
return test_hash_cb[test_choice].populate_hash;
int (*get_populate_hash_cb(void))(void)
{
return test_hash_cb[test_choice].populate_hash;
@@
-157,11
+162,7
@@
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 */
}
@@
-198,6
+199,7
@@
unsigned long test_compare(const void *key1, size_t key1_len,
return 1;
}
return 1;
}
+static
void *thr_count(void *arg)
{
printf_verbose("thread_begin %s, tid %lu\n",
void *thr_count(void *arg)
{
printf_verbose("thread_begin %s, tid %lu\n",
@@
-263,6
+265,7
@@
void test_delete_all_nodes(struct cds_lfht *ht)
printf("deleted %lu nodes.\n", count);
}
printf("deleted %lu nodes.\n", count);
}
+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",
@@
-688,11
+691,11
@@
end_pthread_join:
}
{
char msg[1] = { 0x42 };
}
{
char msg[1] = { 0x42 };
- ssize_t ret;
+ ssize_t
s
ret;
do {
do {
-
ret = write(count_pipe[1], msg, 1);
/* wakeup thread */
- } while (ret == -1L && errno == EINTR);
+
sret = write(count_pipe[1], msg, 1);
/* wakeup thread */
+ } while (
s
ret == -1L && errno == EINTR);
}
err = pthread_join(tid_count, &tret);
if (err != 0) {
}
err = pthread_join(tid_count, &tret);
if (err != 0) {
This page took
0.025455 seconds
and
4
git commands to generate.