sessiond: add smart pointer utils for ltt_session
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 5 May 2022 19:25:39 +0000 (15:25 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 13 Jun 2022 20:34:46 +0000 (16:34 -0400)
commite99e366487cb113a1041e4217ba181feb52d05c9
tree4b8b842aceec1a9ab71665824a01a67c753f9ec8
parent0a325f4dec3f6d553dad5d2c26ebfdc78201c363
sessiond: add smart pointer utils for ltt_session

Add `find_session_by_id` and `find_locked_session_by_id` which return
smart pointers to ltt_session. In both cases, the smart pointers make
use of ltt_session's underlying reference counting mechanism.

In the case of `find_locked_session_by_id`, the session that is returned
is locked; it is automatically unlocked (and a reference is released)
when the pointer goes out of scope. This makes it easier to write
exception-safe code that uses the ltt_session API.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I125dc7592b8ef2de1da645029f311bf429a21767
src/bin/lttng-sessiond/session.cpp
src/bin/lttng-sessiond/session.hpp
This page took 0.028348 seconds and 4 git commands to generate.