projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rculfhash: add CDS_LFHT_ACCOUNTING flag
[urcu.git]
/
tests
/
test_urcu_hash.c
diff --git
a/tests/test_urcu_hash.c
b/tests/test_urcu_hash.c
index cbbddc8c8cef72d9d59a1ee08f1b6e970748bd69..9ae1fa0791cec5bbbf89e4513bd33a030977911d 100644
(file)
--- a/
tests/test_urcu_hash.c
+++ b/
tests/test_urcu_hash.c
@@
-200,7
+200,11
@@
static
void sigusr2_handler(int signo)
{
char msg[1] = { 0x42 };
void sigusr2_handler(int signo)
{
char msg[1] = { 0x42 };
- write(count_pipe[1], msg, 1); /* wakeup thread */
+ ssize_t ret;
+
+ do {
+ ret = write(count_pipe[1], msg, 1); /* wakeup thread */
+ } while (ret == -1L && errno == EINTR);
}
/*
}
/*
@@
-349,9
+353,9
@@
void hashword2(
static
unsigned long test_hash(void *_key, size_t length, unsigned long seed)
{
static
unsigned long test_hash(void *_key, size_t length, unsigned long seed)
{
- unsigned
long key = (unsigned long
) _key;
+ unsigned
int key = (unsigned int
) _key;
- assert(length == sizeof(unsigned
long
));
+ assert(length == sizeof(unsigned
int
));
return hash_u32(&key, 1, seed);
}
#else
return hash_u32(&key, 1, seed);
}
#else
@@
-884,8
+888,9
@@
int main(int argc, char **argv)
*/
rcu_register_thread();
test_ht = cds_lfht_new(test_hash, test_compare, 0x42UL,
*/
rcu_register_thread();
test_ht = cds_lfht_new(test_hash, test_compare, 0x42UL,
- init_hash_size,
- opt_auto_resize ? CDS_LFHT_AUTO_RESIZE : 0, NULL);
+ init_hash_size, 1,
+ (opt_auto_resize ? CDS_LFHT_AUTO_RESIZE : 0) |
+ CDS_LFHT_ACCOUNTING, NULL);
ret = populate_hash();
assert(!ret);
ret = populate_hash();
assert(!ret);
@@
-943,7
+948,11
@@
int main(int argc, char **argv)
}
{
char msg[1] = { 0x42 };
}
{
char msg[1] = { 0x42 };
- write(count_pipe[1], msg, 1); /* wakeup thread */
+ ssize_t ret;
+
+ do {
+ ret = write(count_pipe[1], msg, 1); /* wakeup thread */
+ } while (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.023572 seconds
and
4
git commands to generate.