X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fthread.cpp;h=201917396462230165f91a931c33373d2a556eff;hb=281a10509e36529edb8733a28367122531a63e21;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..201917396 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; @@ -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; }