const auto unlock_list =
lttng::make_scope_exit([]() noexcept { session_unlock_list(); });
- /* locked_ptr will unlock the session and release the ref held by the job. */
+ /* locked_ref will unlock the session and release the ref held by the job. */
session_lock(job->session);
- auto session = ltt_session::locked_ptr(job->session);
+ auto session = ltt_session::locked_ref(job->session);
if (run_job(*job, *session, _notification_thread_handle)) {
return;
session_lock_list();
const auto unlock_list = lttng::make_scope_exit([]() noexcept { session_unlock_list(); });
- ltt_session::locked_ptr session{ [&condition_session_name]() {
+ ltt_session::locked_ref session{ [&condition_session_name]() {
auto raw_session_ptr = session_find_by_name(condition_session_name);
if (raw_session_ptr) {
session_put(session);
}
-ltt_session::locked_ptr ls::find_locked_session_by_id(ltt_session::id_t id)
+ltt_session::locked_ref ls::find_locked_session_by_id(ltt_session::id_t id)
{
lttng::urcu::read_lock_guard rcu_lock;
auto session = session_find_by_id(id);
* session.
*/
session_lock(session);
- return ltt_session::locked_ptr(session);
+ return ltt_session::locked_ref(session);
}
ltt_session::sptr ls::find_session_by_id(ltt_session::id_t id)
*/
struct ltt_session {
using id_t = uint64_t;
- using locked_ptr =
+ using locked_ref =
std::unique_ptr<ltt_session,
lttng::memory::create_deleter_class<
ltt_session,
* for longer than strictly necessary. If your intention is to acquire
* a reference to an ltt_session, see `find_session_by_id()`.
*/
-ltt_session::locked_ptr find_locked_session_by_id(ltt_session::id_t id);
+ltt_session::locked_ref find_locked_session_by_id(ltt_session::id_t id);
ltt_session::sptr find_session_by_id(ltt_session::id_t id);
return registry;
}
-lsu::registry_session::locked_ptr get_locked_session_registry(const struct ust_app_session *ua_sess)
+lsu::registry_session::locked_ref get_locked_session_registry(const struct ust_app_session *ua_sess)
{
auto session = get_session_registry(ua_sess);
if (session) {
pthread_mutex_lock(&session->_lock);
}
- return lsu::registry_session::locked_ptr{ session };
+ return lsu::registry_session::locked_ref{ session };
}
} /* namespace */
static void delete_ust_app_channel(int sock,
struct ust_app_channel *ua_chan,
struct ust_app *app,
- const lsu::registry_session::locked_ptr& locked_registry)
+ const lsu::registry_session::locked_ref& locked_registry)
{
int ret;
struct lttng_ht_iter iter;
* but it can be caused by recoverable errors (e.g. the application has
* terminated concurrently).
*/
-ssize_t ust_app_push_metadata(const lsu::registry_session::locked_ptr& locked_registry,
+ssize_t ust_app_push_metadata(const lsu::registry_session::locked_ref& locked_registry,
struct consumer_socket *socket,
int send_zero_data)
{
* but it can be caused by recoverable errors (e.g. the application has
* terminated concurrently).
*/
-static int push_metadata(const lsu::registry_session::locked_ptr& locked_registry,
+static int push_metadata(const lsu::registry_session::locked_ref& locked_registry,
struct consumer_output *consumer)
{
int ret_val;
void ust_app_add(struct ust_app *app);
struct ust_app *ust_app_create(struct ust_register_msg *msg, int sock);
void ust_app_notify_sock_unregister(int sock);
-ssize_t ust_app_push_metadata(const lttng::sessiond::ust::registry_session::locked_ptr& registry,
+ssize_t ust_app_push_metadata(const lttng::sessiond::ust::registry_session::locked_ref& registry,
struct consumer_socket *socket,
int send_zero_data);
enum lttng_error_code ust_app_snapshot_record(const struct ltt_ust_session *usess,
}
}
-lsu::registry_session::locked_ptr lsu::registry_session::lock() noexcept
+lsu::registry_session::locked_ref lsu::registry_session::lock() noexcept
{
pthread_mutex_lock(&_lock);
- return locked_ptr(this);
+ return locked_ref(this);
}
/*
class registry_session : public lttng::sessiond::trace::trace_class {
public:
- using locked_ptr =
+ using locked_ref =
std::unique_ptr<registry_session,
lttng::memory::create_deleter_class<
registry_session,
details::locked_registry_session_release>::deleter>;
virtual lttng_buffer_type buffering_scheme() const noexcept = 0;
- locked_ptr lock() noexcept;
+ locked_ref lock() noexcept;
void add_channel(uint64_t channel_key);