X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fthread.cpp;fp=src%2Fbin%2Flttng-sessiond%2Fthread.cpp;h=661bc517b2f6a37e8ffa29c935d09f1583f73867;hp=fd9136fe5562b4e5acee6a70bef36061572b38c0;hb=28ab034a2c3582d07d3423d2d746731f87d3969f;hpb=52e345b9ac912d033c2a2c25a170a01cf209839d diff --git a/src/bin/lttng-sessiond/thread.cpp b/src/bin/lttng-sessiond/thread.cpp index fd9136fe5..661bc517b 100644 --- a/src/bin/lttng-sessiond/thread.cpp +++ b/src/bin/lttng-sessiond/thread.cpp @@ -6,12 +6,14 @@ */ #include "thread.hpp" + +#include +#include +#include + +#include #include #include -#include -#include -#include -#include namespace { struct thread_list { @@ -42,8 +44,7 @@ struct lttng_thread { void *data; }; -static -void lttng_thread_destroy(struct lttng_thread *thread) +static void lttng_thread_destroy(struct lttng_thread *thread) { if (thread->cleanup) { thread->cleanup(thread->data); @@ -51,14 +52,12 @@ void lttng_thread_destroy(struct lttng_thread *thread) free(thread); } -static -void lttng_thread_release(struct urcu_ref *ref) +static void lttng_thread_release(struct urcu_ref *ref) { lttng_thread_destroy(lttng::utils::container_of(ref, <tng_thread::ref)); } -static -void *launch_thread(void *data) +static void *launch_thread(void *data) { void *ret; struct lttng_thread *thread = (struct lttng_thread *) data; @@ -71,10 +70,10 @@ void *launch_thread(void *data) } struct lttng_thread *lttng_thread_create(const char *name, - lttng_thread_entry_point entry, - lttng_thread_shutdown_cb shutdown, - lttng_thread_cleanup_cb cleanup, - void *thread_data) + lttng_thread_entry_point entry, + lttng_thread_shutdown_cb shutdown, + lttng_thread_cleanup_cb cleanup, + void *thread_data) { int ret; struct lttng_thread *thread; @@ -105,8 +104,7 @@ struct lttng_thread *lttng_thread_create(const char *name, cds_list_add(&thread->node, &thread_list.head); (void) lttng_thread_get(thread); - ret = pthread_create(&thread->thread, default_pthread_attr(), - launch_thread, thread); + ret = pthread_create(&thread->thread, default_pthread_attr(), launch_thread, thread); if (ret) { PERROR("Failed to create \"%s\" thread", thread->name); goto error_pthread_create; @@ -145,8 +143,7 @@ const char *lttng_thread_get_name(const struct lttng_thread *thread) return thread->name; } -static -bool _lttng_thread_shutdown(struct lttng_thread *thread) +static bool _lttng_thread_shutdown(struct lttng_thread *thread) { int ret; void *status; @@ -191,7 +188,7 @@ void lttng_thread_list_shutdown_orphans(void) struct lttng_thread *thread, *tmp; pthread_mutex_lock(&thread_list.lock); - cds_list_for_each_entry_safe(thread, tmp, &thread_list.head, node) { + cds_list_for_each_entry_safe (thread, tmp, &thread_list.head, node) { bool result; const long ref = uatomic_read(&thread->ref.refcount);