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

index f6a4b2dcd76930d59ae00b2fac0cec49e9aa4ee6..86fee71c7a0711bd12dc3a9c1976d7eee3dda4c8 100644 (file)
@@ -177,17 +177,16 @@ void ctf_trace_put(struct ctf_trace *trace)
 
 int ctf_trace_close(struct ctf_trace *trace)
 {
-       struct relay_stream *stream;
-
-       const lttng::urcu::read_lock_guard read_lock;
-       cds_list_for_each_entry_rcu(stream, &trace->stream_list, stream_node)
-       {
+       for (auto *stream :
+            lttng::urcu::rcu_list_iteration_adapter<relay_stream, &relay_stream::stream_node>(
+                    trace->stream_list)) {
                /*
                 * Close stream since the connection owning the trace is being
                 * torn down.
                 */
                try_stream_close(stream);
        }
+
        /*
         * Since all references to the trace are held by its streams, we
         * don't need to do any self-ref put.
This page took 0.026688 seconds and 4 git commands to generate.