Launch the ht-cleanup thread using lttng_thread util
[lttng-tools.git] / tests / unit / test_session.c
index 74643221c6aa4b93e7d41a63398a9e5b6946bf4b..5db1e758fc8fcbe5641ca6b4498d99eb8fe875cb 100644 (file)
@@ -32,6 +32,7 @@
 #include <bin/lttng-sessiond/ust-app.h>
 #include <bin/lttng-sessiond/ht-cleanup.h>
 #include <bin/lttng-sessiond/health-sessiond.h>
+#include <bin/lttng-sessiond/thread.h>
 #include <common/sessiond-comm/sessiond-comm.h>
 #include <common/common.h>
 
@@ -45,7 +46,6 @@
 
 struct health_app *health_sessiond;
 static struct ltt_session_list *session_list;
-static pthread_t ht_cleanup_thread;
 
 /* For error.h */
 int lttng_opt_quiet = 1;
@@ -315,10 +315,14 @@ void test_large_session_number(void)
 
 int main(int argc, char **argv)
 {
+       struct lttng_thread *ht_cleanup_thread;
+
        plan_tests(NUM_TESTS);
 
        health_sessiond = health_app_create(NR_HEALTH_SESSIOND_TYPES);
-       assert(!init_ht_cleanup_thread(&ht_cleanup_thread));
+       ht_cleanup_thread = launch_ht_cleanup_thread();
+       assert(ht_cleanup_thread);
+       lttng_thread_put(ht_cleanup_thread);
 
        diag("Sessions unit tests");
 
@@ -341,7 +345,7 @@ int main(int argc, char **argv)
        test_large_session_number();
 
        rcu_unregister_thread();
-       assert(!fini_ht_cleanup_thread(&ht_cleanup_thread));
+       lttng_thread_list_shutdown_orphans();
 
        return exit_status();
 }
This page took 0.023587 seconds and 4 git commands to generate.