#include "thread.hpp"
#include "ust-consumer.hpp"
+namespace {
struct thread_notifiers {
struct lttng_pipe *quit_pipe;
struct consumer_data *consumer_data;
sem_t ready;
int initialization_result;
};
+} /* namespace */
static void mark_thread_as_ready(struct thread_notifiers *notifiers)
{
consumer_data->metadata_sock.fd_ptr = &consumer_data->metadata_fd;
/* Create metadata socket lock. */
- consumer_data->metadata_sock.lock = (pthread_mutex_t *) zmalloc(sizeof(pthread_mutex_t));
+ consumer_data->metadata_sock.lock = zmalloc<pthread_mutex_t>();
if (consumer_data->metadata_sock.lock == NULL) {
PERROR("zmalloc pthread mutex");
mark_thread_intialization_as_failed(notifiers);
struct thread_notifiers *notifiers = NULL;
struct lttng_thread *thread;
- notifiers = (thread_notifiers *) zmalloc(sizeof(*notifiers));
+ notifiers = zmalloc<thread_notifiers>();
if (!notifiers) {
goto error_alloc;
}