X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fthread.c;h=26661a36f2aae08c0b21426b9fa343ac9f820a61;hp=ae7f45fd97f8257b645d37513e80c3274410d938;hb=ae0a823f9f7e1d3800479488a58efc2f92f27d89;hpb=4064563ea326f6f26d2c458009beb9ebdb3ba840 diff --git a/src/bin/lttng-sessiond/thread.c b/src/bin/lttng-sessiond/thread.c index ae7f45fd9..26661a36f 100644 --- a/src/bin/lttng-sessiond/thread.c +++ b/src/bin/lttng-sessiond/thread.c @@ -165,22 +165,20 @@ bool _lttng_thread_shutdown(struct lttng_thread *thread) result = false; goto end; } - DBG("Joined thread \"%s\"", thread->name); + /* Release the list's reference to the thread. */ + cds_list_del(&thread->node); + lttng_thread_put(thread); end: return result; } bool lttng_thread_shutdown(struct lttng_thread *thread) { - 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); - } + bool result; + + pthread_mutex_lock(&thread_list.lock); + result = _lttng_thread_shutdown(thread); + pthread_mutex_unlock(&thread_list.lock); return result; }