#include <common/error.hpp>
#include <common/defaults.hpp>
-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;
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
int ret;
struct lttng_thread *thread;
- thread = (lttng_thread *) zmalloc(sizeof(*thread));
+ thread = zmalloc<lttng_thread>();
if (!thread) {
goto error_alloc;
}