X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu.c;h=e6a648981ed8b6b5a0abb679771d98d5e695dd9b;hb=3c24913f970c2dc1dab0a00e3ee9683250667f82;hp=d7993cbe57ca6356816c6d8bd3f2f07f9a340631;hpb=a50a7b4333a5039f1471c0b7cfbfb3d6dc5379fb;p=urcu.git diff --git a/tests/test_urcu.c b/tests/test_urcu.c index d7993cb..e6a6489 100644 --- a/tests/test_urcu.c +++ b/tests/test_urcu.c @@ -3,7 +3,7 @@ * * Userspace RCU library - test program * - * Copyright February 2009 - Mathieu Desnoyers + * Copyright February 2009 - Mathieu Desnoyers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -83,7 +83,7 @@ static unsigned long wduration; static inline void loop_sleep(unsigned long l) { while(l-- != 0) - cpu_relax(); + caa_cpu_relax(); } static int verbose_mode; @@ -231,7 +231,7 @@ void *thr_reader(void *_count) while (!test_go) { } - smp_mb(); + cmm_smp_mb(); for (;;) { rcu_read_lock(); @@ -249,6 +249,10 @@ void *thr_reader(void *_count) rcu_unregister_thread(); + /* test extra thread registration */ + rcu_register_thread(); + rcu_unregister_thread(); + *count = nr_reads; printf_verbose("thread_end %s, thread id : %lx, tid %lu\n", "reader", pthread_self(), (unsigned long)gettid()); @@ -269,7 +273,7 @@ void *thr_writer(void *_count) while (!test_go) { } - smp_mb(); + cmm_smp_mb(); for (;;) { new = test_array_alloc(); @@ -417,7 +421,7 @@ int main(int argc, char **argv) exit(1); } - smp_mb(); + cmm_smp_mb(); test_go = 1;