X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_assign.c;h=a73fc23892aa37961de60c409d6b2dbae0d11d49;hb=74670647a01545eddb46ce4ab55169072692fdd8;hp=b1298a447762397c14a452f0b8bd4f2b2e4d6ec8;hpb=6982d6d71aeed16d2d929bd0ed221e8f444b706e;p=urcu.git diff --git a/tests/test_urcu_assign.c b/tests/test_urcu_assign.c index b1298a4..a73fc23 100644 --- a/tests/test_urcu_assign.c +++ b/tests/test_urcu_assign.c @@ -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(); @@ -269,7 +269,7 @@ void *thr_writer(void *_count) while (!test_go) { } - smp_mb(); + cmm_smp_mb(); for (;;) { new = test_array_alloc(); @@ -399,7 +399,7 @@ int main(int argc, char **argv) printf_verbose("thread %-6s, thread id : %lx, tid %lu\n", "main", pthread_self(), (unsigned long)gettid()); - test_array = malloc(sizeof(*test_array) * ARRAY_SIZE); + test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE); tid_reader = malloc(sizeof(*tid_reader) * nr_readers); tid_writer = malloc(sizeof(*tid_writer) * nr_writers); count_reader = malloc(sizeof(*count_reader) * nr_readers); @@ -420,7 +420,7 @@ int main(int argc, char **argv) exit(1); } - smp_mb(); + cmm_smp_mb(); test_go = 1;