From: Jérémie Galarneau Date: Fri, 26 Jul 2024 19:18:59 +0000 (+0000) Subject: sessiond: agent-thread.cpp: iterate on lfht using lfht_iteration_adapter X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=993d9c5dda38eac14a19532e9340f471da160eb8;p=lttng-tools.git sessiond: agent-thread.cpp: iterate on lfht using lfht_iteration_adapter Change-Id: I059c11d8820ffb8416f265a59e21b66d884d722d Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/agent-thread.cpp b/src/bin/lttng-sessiond/agent-thread.cpp index 8925db4f9..fa98f5f0b 100644 --- a/src/bin/lttng-sessiond/agent-thread.cpp +++ b/src/bin/lttng-sessiond/agent-thread.cpp @@ -61,8 +61,6 @@ static void update_agent_app(const struct agent_app *app) { struct ltt_session *session, *stmp; struct ltt_session_list *list; - struct agent *trigger_agent; - struct lttng_ht_iter iter; list = session_get_list(); LTTNG_ASSERT(list); @@ -86,17 +84,14 @@ static void update_agent_app(const struct agent_app *app) session_put(session); } - { - /* - * We are protected against the addition of new events by the session - * list lock being held. - */ - const lttng::urcu::read_lock_guard read_lock; - - cds_lfht_for_each_entry ( - the_trigger_agents_ht_by_domain->ht, &iter.iter, trigger_agent, node.node) { - agent_update(trigger_agent, app); - } + /* + * We are protected against the addition of new events by the session + * list lock being held. + */ + for (auto *trigger_agent : + lttng::urcu::lfht_iteration_adapter( + *the_trigger_agents_ht_by_domain->ht)) { + agent_update(trigger_agent, app); } }