X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fthread.cpp;h=fd9136fe5562b4e5acee6a70bef36061572b38c0;hb=4f2da8b8c0f8fad2ae35dbdb9f29769da52a3dc1;hp=9ce539b816a99732cf0a6c3ed5c3901584e8e44a;hpb=c9e313bc594f40a86eed237dce222c0fc99c957f;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/thread.cpp b/src/bin/lttng-sessiond/thread.cpp index 9ce539b81..fd9136fe5 100644 --- a/src/bin/lttng-sessiond/thread.cpp +++ b/src/bin/lttng-sessiond/thread.cpp @@ -13,13 +13,15 @@ #include #include -static struct thread_list { +namespace { +struct thread_list { struct cds_list_head head; pthread_mutex_t lock; } thread_list = { .head = CDS_LIST_HEAD_INIT(thread_list.head), .lock = PTHREAD_MUTEX_INITIALIZER, }; +} /* namespace */ struct lttng_thread { struct urcu_ref ref; @@ -52,7 +54,7 @@ void lttng_thread_destroy(struct lttng_thread *thread) static void lttng_thread_release(struct urcu_ref *ref) { - lttng_thread_destroy(container_of(ref, struct lttng_thread, ref)); + lttng_thread_destroy(lttng::utils::container_of(ref, <tng_thread::ref)); } static @@ -77,7 +79,7 @@ struct lttng_thread *lttng_thread_create(const char *name, int ret; struct lttng_thread *thread; - thread = (lttng_thread *) zmalloc(sizeof(*thread)); + thread = zmalloc(); if (!thread) { goto error_alloc; }