sessiond: session registry: use pthread::lock_guard instead of raw lock
[lttng-tools.git] / 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.025306 seconds and 4 git commands to generate.