From: Jérémie Galarneau Date: Tue, 30 Jul 2024 20:00:15 +0000 (+0000) Subject: relayd: session.cpp: iterate on rcu list using rcu_list_iteration_adapter X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2c6aa850db9935107fcd8d691f8324afeb91f5ff;p=lttng-tools.git relayd: session.cpp: iterate on rcu list using rcu_list_iteration_adapter Change-Id: I9cfca29e54873c696ef6b8c84454e77e299ddd10 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/session.cpp b/src/bin/lttng-relayd/session.cpp index 339034f0c..e05482f15 100644 --- a/src/bin/lttng-relayd/session.cpp +++ b/src/bin/lttng-relayd/session.cpp @@ -617,7 +617,6 @@ void session_put(struct relay_session *session) int session_close(struct relay_session *session) { int ret = 0; - struct relay_stream *stream; pthread_mutex_lock(&session->lock); DBG("closing session %" PRIu64 ": is conn already closed %d", @@ -636,8 +635,9 @@ int session_close(struct relay_session *session) } } - cds_list_for_each_entry_rcu(stream, &session->recv_list, recv_node) - { + for (auto *stream : + lttng::urcu::rcu_list_iteration_adapter( + session->recv_list)) { /* Close streams which have not been published yet. */ try_stream_close(stream); }