Fix: move testpoint after state update
[lttng-tools.git] / src / bin / lttng-sessiond / register.c
index 36e1a0d31f0a8524e3a47a5962b4ce7a4698f7ce..d57a564cf6ec6f38ec5210f9a7397931eedc695a 100644 (file)
@@ -175,7 +175,7 @@ static void *thread_application_registration(void *data)
 
        DBG("[thread] Manage application registration started");
 
-       pthread_cleanup_push(thread_init_cleanup, NULL);
+       pthread_cleanup_push(thread_init_cleanup, thread_state);
        health_register(health_sessiond, HEALTH_SESSIOND_TYPE_APP_REG);
 
        ret = lttcomm_listen_unix_sock(application_socket);
@@ -183,10 +183,6 @@ static void *thread_application_registration(void *data)
                goto error_listen;
        }
 
-       if (testpoint(sessiond_thread_registration_apps)) {
-               goto error_create_poll;
-       }
-
        /*
         * Pass 2 as size here for the thread quit pipe and apps_sock. Nothing
         * more will be added to this poll set.
@@ -211,6 +207,10 @@ static void *thread_application_registration(void *data)
        set_thread_status(thread_state, true);
        pthread_cleanup_pop(0);
 
+       if (testpoint(sessiond_thread_registration_apps)) {
+               goto error_poll_add;
+       }
+
        while (1) {
                DBG("Accepting application registration");
 
This page took 0.022992 seconds and 4 git commands to generate.