From: Jérémie Galarneau Date: Thu, 12 May 2022 19:22:50 +0000 (-0400) Subject: sessiond: session registry: use pthread::lock_guard instead of raw lock X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=17fd219bebc7165e6085c3439feb349e7610b528;p=lttng-tools.git sessiond: session registry: use pthread::lock_guard instead of raw lock Signed-off-by: Jérémie Galarneau Change-Id: I3f5227782701a82257b710232fc02bd3c61a2e20 --- diff --git a/src/bin/lttng-sessiond/ust-registry-session.cpp b/src/bin/lttng-sessiond/ust-registry-session.cpp index 2aaed4ef9..20dbc41a5 100644 --- a/src/bin/lttng-sessiond/ust-registry-session.cpp +++ b/src/bin/lttng-sessiond/ust-registry-session.cpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include #include @@ -152,9 +154,9 @@ ust_registry_session::~ust_registry_session() void ust_registry_session::statedump() { - pthread_mutex_lock(&_lock); + lttng::pthread::lock_guard registry_lock(_lock); + const int ret = ust_metadata_session_statedump(this); - pthread_mutex_unlock(&_lock); if (ret) { LTTNG_THROW_ERROR( "Failed to generate session metadata during registry session creation");