Fix: tests: register thread for RCU operations.
[lttng-tools.git] / tests / unit / test_session.c
index a0e84e9eadeae103b20be81697629d90d7ddf92e..1e633187f8299c6b9d49af3b9d245384fd9612a9 100644 (file)
@@ -16,7 +16,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#define _GNU_SOURCE
 #include <assert.h>
 #include <errno.h>
 #include <stdio.h>
@@ -25,6 +24,7 @@
 #include <unistd.h>
 #include <time.h>
 #include <sys/types.h>
+#include <urcu.h>
 
 #include <tap/tap.h>
 
@@ -46,6 +46,7 @@ static struct ltt_session_list *session_list;
 /* For error.h */
 int lttng_opt_quiet = 1;
 int lttng_opt_verbose = 0;
+int lttng_opt_mi;
 
 int ust_consumerd32_fd;
 int ust_consumerd64_fd;
@@ -108,8 +109,7 @@ static void empty_session_list(void)
        struct ltt_session *iter, *tmp;
 
        cds_list_for_each_entry_safe(iter, tmp, &session_list->head, list) {
-               cds_list_del(&iter->list);
-               free(iter);
+               session_destroy(iter);
        }
 
        /* Session list must be 0 */
@@ -296,6 +296,8 @@ int main(int argc, char **argv)
 
        diag("Sessions unit tests");
 
+       rcu_register_thread();
+
        test_session_list();
 
        test_create_one_session();
@@ -312,5 +314,7 @@ int main(int argc, char **argv)
 
        test_large_session_number();
 
+       rcu_unregister_thread();
+
        return exit_status();
 }
This page took 0.024024 seconds and 4 git commands to generate.