Docs: notification comment refers to a structure by its former name
[lttng-tools.git] / src / bin / lttng-sessiond / notification-thread.c
index 059e620598b68b2a84e731980d836f14bd7d1002..7bd65361a25a7b97063305ca8eec2e0b6551abbf 100644 (file)
@@ -25,7 +25,6 @@
 #include <common/config/session-config.h>
 #include <common/defaults.h>
 #include <common/utils.h>
-#include <common/futex.h>
 #include <common/align.h>
 #include <common/time.h>
 #include <sys/eventfd.h>
@@ -69,7 +68,7 @@
  *
  *   - notification_trigger_clients_ht:
  *             associates notification-emitting triggers to clients
- *             (struct notification_client_ht_node) subscribed to those
+ *             (struct notification_client_list) subscribed to those
  *             conditions.
  *             The condition's hash and match functions are used directly since
  *             all triggers in this hash table have the "notify" action.
@@ -158,7 +157,6 @@ void notification_thread_handle_destroy(
                struct notification_thread_handle *handle)
 {
        int ret;
-       struct notification_thread_command *cmd, *tmp;
 
        if (!handle) {
                goto end;
@@ -172,15 +170,7 @@ void notification_thread_handle_destroy(
                PERROR("close notification command queue event_fd");
        }
 
-       pthread_mutex_lock(&handle->cmd_queue.lock);
-       /* Purge queue of in-flight commands and mark them as cancelled. */
-       cds_list_for_each_entry_safe(cmd, tmp, &handle->cmd_queue.list,
-                       cmd_list_node) {
-               cds_list_del(&cmd->cmd_list_node);
-               cmd->reply_code = LTTNG_ERR_COMMAND_CANCELLED;
-               futex_nto1_wake(&cmd->reply_futex);
-       }
-       pthread_mutex_unlock(&handle->cmd_queue.lock);
+       assert(cds_list_empty(&handle->cmd_queue.list));
        pthread_mutex_destroy(&handle->cmd_queue.lock);
 
        if (handle->channel_monitoring_pipes.ust32_consumer >= 0) {
@@ -219,7 +209,7 @@ struct notification_thread_handle *notification_thread_handle_create(
        }
 
        /* FIXME Replace eventfd by a pipe to support older kernels. */
-       handle->cmd_queue.event_fd = eventfd(0, EFD_CLOEXEC);
+       handle->cmd_queue.event_fd = eventfd(0, EFD_CLOEXEC | EFD_SEMAPHORE);
        if (handle->cmd_queue.event_fd < 0) {
                PERROR("eventfd notification command queue");
                goto error;
This page took 0.023345 seconds and 4 git commands to generate.