static enum test_hash test_choice = TEST_HASH_RW;
+static
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;
}
+static
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;
}
+static
int (*get_populate_hash_cb(void))(void)
{
return test_hash_cb[test_choice].populate_hash;
return 1;
}
+static
void *thr_count(void *arg)
{
printf_verbose("thread_begin %s, tid %lu\n",
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",
}
{
char msg[1] = { 0x42 };
- ssize_t ret;
+ ssize_t sret;
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 (sret == -1L && errno == EINTR);
}
err = pthread_join(tid_count, &tret);
if (err != 0) {