summaryrefslogtreecommitdiff
path: root/src/storage/plugins
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-01-03 07:11:57 +0100
committerMax Kellermann <max@musicpd.org>2017-01-03 07:11:57 +0100
commit2e182e84c35c73f8d5b4f135ffa3550b7e70f66f (patch)
tree806ec01525f834132c46e6392714900ec75eada2 /src/storage/plugins
parenta42021655c3218c64272b648438197247ec7f6a9 (diff)
thread/Mutex: remove ScopeLock, use std::lock_guard directly
Diffstat (limited to 'src/storage/plugins')
-rw-r--r--src/storage/plugins/NfsStorage.cxx6
-rw-r--r--src/storage/plugins/SmbclientStorage.cxx8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/storage/plugins/NfsStorage.cxx b/src/storage/plugins/NfsStorage.cxx
index f4f16edbc..edf9b1b92 100644
--- a/src/storage/plugins/NfsStorage.cxx
+++ b/src/storage/plugins/NfsStorage.cxx
@@ -133,7 +133,7 @@ private:
void SetState(State _state) {
assert(GetEventLoop().IsInside());
- const ScopeLock protect(mutex);
+ const std::lock_guard<Mutex> protect(mutex);
state = _state;
cond.broadcast();
}
@@ -141,7 +141,7 @@ private:
void SetState(State _state, std::exception_ptr &&e) {
assert(GetEventLoop().IsInside());
- const ScopeLock protect(mutex);
+ const std::lock_guard<Mutex> protect(mutex);
state = _state;
last_exception = std::move(e);
cond.broadcast();
@@ -164,7 +164,7 @@ private:
}
void WaitConnected() {
- const ScopeLock protect(mutex);
+ const std::lock_guard<Mutex> protect(mutex);
while (true) {
switch (state) {
diff --git a/src/storage/plugins/SmbclientStorage.cxx b/src/storage/plugins/SmbclientStorage.cxx
index 0fe5b128b..0b4de5683 100644
--- a/src/storage/plugins/SmbclientStorage.cxx
+++ b/src/storage/plugins/SmbclientStorage.cxx
@@ -97,7 +97,7 @@ GetInfo(const char *path)
struct stat st;
{
- const ScopeLock protect(smbclient_mutex);
+ const std::lock_guard<Mutex> protect(smbclient_mutex);
if (smbc_stat(path, &st) != 0)
throw MakeErrno("Failed to access file");
}
@@ -132,7 +132,7 @@ SmbclientStorage::OpenDirectory(const char *uri_utf8)
int handle;
{
- const ScopeLock protect(smbclient_mutex);
+ const std::lock_guard<Mutex> protect(smbclient_mutex);
handle = smbc_opendir(mapped.c_str());
if (handle < 0)
throw MakeErrno("Failed to open directory");
@@ -160,7 +160,7 @@ SmbclientDirectoryReader::~SmbclientDirectoryReader()
const char *
SmbclientDirectoryReader::Read()
{
- const ScopeLock protect(smbclient_mutex);
+ const std::lock_guard<Mutex> protect(smbclient_mutex);
struct smbc_dirent *e;
while ((e = smbc_readdir(handle)) != nullptr) {
@@ -187,7 +187,7 @@ CreateSmbclientStorageURI(gcc_unused EventLoop &event_loop, const char *base)
SmbclientInit();
- const ScopeLock protect(smbclient_mutex);
+ const std::lock_guard<Mutex> protect(smbclient_mutex);
SMBCCTX *ctx = smbc_new_context();
if (ctx == nullptr)
throw MakeErrno("smbc_new_context() failed");