Allow tests to run on architectures without per-cpu call_rcu support
[urcu.git] / tests / test_urcu_lfs.c
index c85fa447c37afd7eb48da32f1c10811e57fd9d85..b48a35fe0f1c77ebaf9806cc03422ce8567e74ba 100644 (file)
@@ -189,11 +189,11 @@ void *thr_enqueuer(void *_count)
                cds_lfs_push_rcu(&s, &node->list);
                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;
        }
 
@@ -252,9 +252,9 @@ void *thr_dequeuer(void *_count)
                        nr_successful_dequeues++;
                }
                nr_dequeues++;
-               if (unlikely(!test_duration_dequeue()))
+               if (caa_unlikely(!test_duration_dequeue()))
                        break;
-               if (unlikely(rduration))
+               if (caa_unlikely(rduration))
                        loop_sleep(rduration);
        }
 
@@ -379,7 +379,9 @@ int main(int argc, char **argv)
        count_dequeuer = malloc(2 * sizeof(*count_dequeuer) * nr_dequeuers);
        cds_lfs_init_rcu(&s);
        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;
 
This page took 0.022884 seconds and 4 git commands to generate.