X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmain.c;h=edf7f1b859bc38301fef9b59a50917de3fb52c09;hb=bfc52f7cb4c9ad566382813f7c6904521f4bb21e;hp=26ef1070b65da3be3bdf5d5700a7c1e88e4169bb;hpb=05032b8c74e4808c4dd1d0bf9f39d751a47bd3a8;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 26ef1070b..edf7f1b85 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -6141,6 +6141,13 @@ exit_init_data: rcu_thread_offline(); rcu_unregister_thread(); + /* + * Ensure all prior call_rcu are done. call_rcu callbacks may push + * hash tables to the ht_cleanup thread. Therefore, we ensure that + * the queue is empty before shutting down the clean-up thread. + */ + rcu_barrier(); + ret = notify_thread_pipe(ht_cleanup_quit_pipe[1]); if (ret < 0) { ERR("write error on ht_cleanup quit pipe"); @@ -6170,9 +6177,6 @@ exit_health_sessiond_cleanup: exit_create_run_as_worker_cleanup: exit_options: - /* Ensure all prior call_rcu are done. */ - rcu_barrier(); - sessiond_cleanup_options(); exit_set_signal_handler: