- cds_list_for_each_entry_safe (session, tmp, &session_list->head, list) {
- if (!session_get(session)) {
- continue;
- }
+ for (auto raw_session_ptr :
+ lttng::urcu::list_iteration_adapter<ltt_session, <t_session::list>(
+ session_list->head)) {
+ const auto session = [raw_session_ptr]() {
+ session_get(raw_session_ptr);
+ raw_session_ptr->lock();
+ return ltt_session::make_locked_ref(*raw_session_ptr);
+ }();