Docs: sessiond: document the rationale for the iteration on triggers list
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Apr 2021 16:50:51 +0000 (12:50 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Apr 2021 16:55:45 +0000 (12:55 -0400)
Document the reason why an iteration is performed on the list of
triggers of a "client list" when a client subscribes to a condition.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I7d1c15016064ff2f6498c925f4933450fc7da30b

src/bin/lttng-sessiond/notification-thread-events.c
src/bin/lttng-sessiond/notification-thread-internal.h

index d3b6cd855da47b872ae11e7fa3cbc4446e8de6a3..4623ef38c463edb281a6eaaaedfdb8521dfb4db6 100644 (file)
@@ -1139,9 +1139,10 @@ int notification_thread_client_subscribe(struct notification_client *client,
         * at this point so that conditions that are already TRUE result
         * in a notification being sent out.
         *
-        * The client_list's trigger is used without locking the list itself.
-        * This is correct since the list doesn't own the trigger and the
-        * object is immutable.
+        * Note the iteration on all triggers which share an identical
+        * `condition` than the one to which the client is registering. This is
+        * done to ensure that the client receives a distinct notification for
+        * all triggers that have a `notify` action that have this condition.
         */
        pthread_mutex_lock(&client_list->lock);
        cds_list_for_each_entry(trigger_ht_element,
index fe53a51613528fe2ba4a2255030a6f583b180635..e835bd6afe3cad4ab2532059db867aeb16e59e6a 100644 (file)
@@ -114,6 +114,7 @@ struct notification_client_list {
        pthread_mutex_t lock;
        struct urcu_ref ref;
        struct lttng_condition *condition;
+       /* List of triggers that have an identical condition than `condition`. */
        struct cds_list_head triggers_list;
        struct cds_list_head clients_list;
        /* Weak reference to container. */
This page took 0.032044 seconds and 4 git commands to generate.