sessiond: session registry: use pthread::lock_guard instead of raw lock
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 12 May 2022 19:22:50 +0000 (15:22 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 13 Jun 2022 20:34:47 +0000 (16:34 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I3f5227782701a82257b710232fc02bd3c61a2e20

src/bin/lttng-sessiond/ust-registry-session.cpp

index 2aaed4ef96850eee2caf82d9bfb28b2b678d3c81..20dbc41a55a02cb60ea5c05ba4cd43562abaef2d 100644 (file)
@@ -10,6 +10,8 @@
 #include <common/compat/directory-handle.hpp>
 #include <common/error.hpp>
 #include <common/exception.hpp>
+#include <common/macros.hpp>
+#include <common/pthread-lock.hpp>
 #include <common/runas.hpp>
 
 #include <fcntl.h>
@@ -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");
This page took 0.026064 seconds and 4 git commands to generate.