From 2c0a9687359b8b90a2c4635c24f284fb8d307363 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 25 Apr 2019 19:23:14 +0200 Subject: [PATCH] storage/smbclient: use std::lock_guard --- src/storage/plugins/SmbclientStorage.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/storage/plugins/SmbclientStorage.cxx b/src/storage/plugins/SmbclientStorage.cxx index 0324bf219..456dd3f44 100644 --- a/src/storage/plugins/SmbclientStorage.cxx +++ b/src/storage/plugins/SmbclientStorage.cxx @@ -59,9 +59,8 @@ public: :base(_base), ctx(_ctx) {} virtual ~SmbclientStorage() { - smbclient_mutex.lock(); + const std::lock_guard lock(smbclient_mutex); smbc_free_context(ctx, 1); - smbclient_mutex.unlock(); } /* virtual methods from class Storage */ @@ -153,9 +152,8 @@ SkipNameFS(const char *name) noexcept SmbclientDirectoryReader::~SmbclientDirectoryReader() { - smbclient_mutex.lock(); + const std::lock_guard lock(smbclient_mutex); smbc_close(handle); - smbclient_mutex.unlock(); } const char *