From 0938c5415e2a0bf18afc9a225466ddf01e7cbb3d Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 10 Sep 2011 23:45:59 -0700 Subject: [PATCH] Pair all_cpu call_rcu create with free Signed-off-by: Mathieu Desnoyers --- tests/test_urcu_lfq.c | 1 + tests/test_urcu_lfs.c | 1 + urcu-call-rcu-impl.h | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_urcu_lfq.c b/tests/test_urcu_lfq.c index 2d701f2..5292ebd 100644 --- a/tests/test_urcu_lfq.c +++ b/tests/test_urcu_lfq.c @@ -450,6 +450,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); diff --git a/tests/test_urcu_lfs.c b/tests/test_urcu_lfs.c index e02fa58..c85fa44 100644 --- a/tests/test_urcu_lfs.c +++ b/tests/test_urcu_lfs.c @@ -446,6 +446,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); diff --git a/urcu-call-rcu-impl.h b/urcu-call-rcu-impl.h index 38cc001..c14cc18 100644 --- a/urcu-call-rcu-impl.h +++ b/urcu-call-rcu-impl.h @@ -482,7 +482,9 @@ void set_thread_call_rcu_data(struct call_rcu_data *crdp) /* * Create a separate call_rcu thread for each CPU. This does not * replace a pre-existing call_rcu thread -- use the set_cpu_call_rcu_data() - * function if you want that behavior. + * function if you want that behavior. Should be paired with + * free_all_cpu_call_rcu_data() to teardown these call_rcu worker + * threads. */ int create_all_cpu_call_rcu_data(unsigned long flags) -- 2.34.1