Fix: use lttng_waiter instead of futex in notification thread
[lttng-tools.git] / src / bin / lttng-sessiond / notification-thread-commands.c
index 5483a317f60c28bedd8a5ecf96ac87768d9ed52d..d9fdf01588465a3e826bbc53b3a0e6cb35d29705 100644 (file)
@@ -20,7 +20,6 @@
 #include "notification-thread.h"
 #include "notification-thread-commands.h"
 #include <common/error.h>
-#include <common/futex.h>
 #include <unistd.h>
 #include <stdint.h>
 #include <inttypes.h>
@@ -30,6 +29,7 @@ void init_notification_thread_command(struct notification_thread_command *cmd)
 {
        memset(cmd, 0, sizeof(*cmd));
        CDS_INIT_LIST_HEAD(&cmd->cmd_list_node);
+       lttng_waiter_init(&cmd->reply_waiter);
 }
 
 static
@@ -39,8 +39,6 @@ int run_command_wait(struct notification_thread_handle *handle,
        int ret;
        uint64_t notification_counter = 1;
 
-       futex_nto1_prepare(&cmd->reply_futex);
-
        pthread_mutex_lock(&handle->cmd_queue.lock);
        /* Add to queue. */
        cds_list_add_tail(&cmd->cmd_list_node,
@@ -59,7 +57,7 @@ int run_command_wait(struct notification_thread_handle *handle,
        }
        pthread_mutex_unlock(&handle->cmd_queue.lock);
 
-       futex_nto1_wait(&cmd->reply_futex);
+       lttng_waiter_wait(&cmd->reply_waiter);
        return 0;
 error_unlock_queue:
        pthread_mutex_unlock(&handle->cmd_queue.lock);
This page took 0.031248 seconds and 4 git commands to generate.