From: Jérémie Galarneau Date: Thu, 5 May 2022 19:25:39 +0000 (-0400) Subject: sessiond: add smart pointer utils for ltt_session X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;h=e99e366487cb113a1041e4217ba181feb52d05c9;hp=e99e366487cb113a1041e4217ba181feb52d05c9;p=lttng-tools.git 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 Change-Id: I125dc7592b8ef2de1da645029f311bf429a21767 ---