int ret;
struct ltt_kernel_channel *channel;
struct ltt_session *session;
- const struct ltt_session_list *session_list = session_get_list();
DBG("Updating kernel poll set");
- session_lock_list();
+ const auto list_lock = lttng::sessiond::lock_session_list();
+ const struct ltt_session_list *session_list = session_get_list();
+
cds_list_for_each_entry (session, &session_list->head, list) {
if (!session_get(session)) {
continue;
if (ret < 0) {
session_unlock(session);
session_put(session);
- goto error;
+ return -1;
}
DBG("Channel fd %d added to kernel set", channel->fd);
}
session_unlock(session);
session_put(session);
}
- session_unlock_list();
return 0;
-
-error:
- session_unlock_list();
- return -1;
}
/*
struct ltt_session *session;
struct ltt_kernel_session *ksess;
struct ltt_kernel_channel *channel;
- const struct ltt_session_list *session_list = session_get_list();
DBG("Updating kernel streams for channel fd %d", fd);
- session_lock_list();
+ const auto list_lock = lttng::sessiond::lock_session_list();
+ const struct ltt_session_list *session_list = session_get_list();
+
cds_list_for_each_entry (session, &session_list->head, list) {
if (!session_get(session)) {
continue;
session_unlock(session);
session_put(session);
}
- session_unlock_list();
+
return ret;
error:
session_unlock(session);
session_put(session);
- session_unlock_list();
return ret;
}