From 8bcbd94a60f624c1faae1481fcb0888aec25b481 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sun, 4 Mar 2012 15:50:07 -0500 Subject: [PATCH] Allow tests to run on architectures without per-cpu call_rcu support Signed-off-by: Mathieu Desnoyers --- tests/test_urcu_hash.c | 4 +++- tests/test_urcu_lfq.c | 4 +++- tests/test_urcu_lfs.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/test_urcu_hash.c b/tests/test_urcu_hash.c index c8d8a89..aac1db8 100644 --- a/tests/test_urcu_hash.c +++ b/tests/test_urcu_hash.c @@ -1015,7 +1015,9 @@ int main(int argc, char **argv) count_writer = malloc(sizeof(*count_writer) * nr_writers); 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"); + } if (memory_backend) { test_ht = _cds_lfht_new(init_hash_size, min_hash_alloc_size, diff --git a/tests/test_urcu_lfq.c b/tests/test_urcu_lfq.c index 11e7eb3..01a2781 100644 --- a/tests/test_urcu_lfq.c +++ b/tests/test_urcu_lfq.c @@ -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; diff --git a/tests/test_urcu_lfs.c b/tests/test_urcu_lfs.c index 883fd0c..b48a35f 100644 --- a/tests/test_urcu_lfs.c +++ b/tests/test_urcu_lfs.c @@ -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; -- 2.34.1