sessiond: trigger: run trigger actions through an action executor
[lttng-tools.git] / src / bin / lttng-sessiond / thread.c
index 26661a36f2aae08c0b21426b9fa343ac9f820a61..ae7f45fd97f8257b645d37513e80c3274410d938 100644 (file)
@@ -165,20 +165,22 @@ bool _lttng_thread_shutdown(struct lttng_thread *thread)
                result = false;
                goto end;
        }
-       /* Release the list's reference to the thread. */
-       cds_list_del(&thread->node);
-       lttng_thread_put(thread);
+       DBG("Joined thread \"%s\"", thread->name);
 end:
        return result;
 }
 
 bool lttng_thread_shutdown(struct lttng_thread *thread)
 {
-       bool result;
-
-       pthread_mutex_lock(&thread_list.lock);
-       result = _lttng_thread_shutdown(thread);
-       pthread_mutex_unlock(&thread_list.lock);
+       const bool result = _lttng_thread_shutdown(thread);
+
+       if (result) {
+               /* Release the list's reference to the thread. */
+               pthread_mutex_lock(&thread_list.lock);
+               cds_list_del(&thread->node);
+               lttng_thread_put(thread);
+               pthread_mutex_unlock(&thread_list.lock);
+       }
        return result;
 }
 
This page took 0.023383 seconds and 4 git commands to generate.