relayd: session.cpp: iterate on rcu list using rcu_list_iteration_adapter
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 30 Jul 2024 20:00:15 +0000 (20:00 +0000)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 31 Jul 2024 03:36:52 +0000 (23:36 -0400)
Change-Id: I9cfca29e54873c696ef6b8c84454e77e299ddd10
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/session.cpp

index 339034f0cdccb282066fb8bda6b60c06423aab6d..e05482f15622995673aa71aabe3abc92a0b0d779 100644 (file)
@@ -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<relay_stream, &relay_stream::recv_node>(
+                    session->recv_list)) {
                /* Close streams which have not been published yet. */
                try_stream_close(stream);
        }
This page took 0.02775 seconds and 4 git commands to generate.