X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_lfq.c;h=01a2781530741de5fa944959f00e98ddf2ec6dda;hb=e75bc03fe3ded2faa5a77bd1370b994cd60b4865;hp=2d701f2913a7244b36a24b2e493d515d05377847;hpb=94aec12284c03da90d879b4d55280f9cbf0e183a;p=urcu.git diff --git a/tests/test_urcu_lfq.c b/tests/test_urcu_lfq.c index 2d701f2..01a2781 100644 --- a/tests/test_urcu_lfq.c +++ b/tests/test_urcu_lfq.c @@ -190,11 +190,11 @@ void *thr_enqueuer(void *_count) rcu_read_unlock(); nr_successful_enqueues++; - if (unlikely(wdelay)) + if (caa_unlikely(wdelay)) loop_sleep(wdelay); fail: nr_enqueues++; - if (unlikely(!test_duration_enqueue())) + if (caa_unlikely(!test_duration_enqueue())) break; } @@ -255,9 +255,9 @@ void *thr_dequeuer(void *_count) } nr_dequeues++; - if (unlikely(!test_duration_dequeue())) + if (caa_unlikely(!test_duration_dequeue())) break; - if (unlikely(rduration)) + if (caa_unlikely(rduration)) loop_sleep(rduration); } @@ -381,7 +381,9 @@ int main(int argc, char **argv) count_dequeuer = malloc(2 * sizeof(*count_dequeuer) * nr_dequeuers); cds_lfq_init_rcu(&q, call_rcu); err = create_all_cpu_call_rcu_data(0); - assert(!err); + if (err) { + printf("Per-CPU call_rcu() worker threads unavailable. Using default global worker thread.\n"); + } next_aff = 0; @@ -450,6 +452,7 @@ int main(int argc, char **argv) tot_successful_enqueues, tot_successful_dequeues + end_dequeues); + free_all_cpu_call_rcu_data(); free(count_enqueuer); free(count_dequeuer); free(tid_enqueuer);