From: Jérémie Galarneau Date: Tue, 30 Jul 2024 20:32:50 +0000 (+0000) Subject: relayd: ctf-trace.cpp: iterate on rcu list using rcu_list_iteration_adapter X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=eb836862527b18c26efceb7d3e5b347b5a88b689;p=lttng-tools.git relayd: ctf-trace.cpp: iterate on rcu list using rcu_list_iteration_adapter Change-Id: I5c16d02d44fc90b9bf9336ac6cd795398d4ab4f5 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/ctf-trace.cpp b/src/bin/lttng-relayd/ctf-trace.cpp index f6a4b2dcd..86fee71c7 100644 --- a/src/bin/lttng-relayd/ctf-trace.cpp +++ b/src/bin/lttng-relayd/ctf-trace.cpp @@ -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( + 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.