summaryrefslogtreecommitdiff
path: root/src/command
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-04-26 19:19:45 +0200
committerMax Kellermann <max@musicpd.org>2019-05-07 19:09:39 +0200
commit1b5c1f75a401623cd279466dcb99f8e718d8c7c4 (patch)
tree73ca6bc2c3c9c05c4b23e1b9a4bf97072f672a3d /src/command
parent040573c636c2c3780ceeb6301854dba4eb68b0e2 (diff)
input/InputStreams: pass std::unique_lock<> to various methods
Diffstat (limited to 'src/command')
-rw-r--r--src/command/FileCommands.cxx6
-rw-r--r--src/command/FingerprintCommands.cxx2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/command/FileCommands.cxx b/src/command/FileCommands.cxx
index 448da2caf..9f040bd8b 100644
--- a/src/command/FileCommands.cxx
+++ b/src/command/FileCommands.cxx
@@ -292,9 +292,9 @@ read_stream_art(Response &r, const char *uri, size_t offset)
size_t read_size;
{
- const std::lock_guard<Mutex> protect(mutex);
- is->Seek(offset);
- read_size = is->Read(&buffer, CHUNK_SIZE);
+ std::unique_lock<Mutex> lock(mutex);
+ is->Seek(lock, offset);
+ read_size = is->Read(lock, &buffer, CHUNK_SIZE);
}
r.Format("size: %" PRIoffset "\n"
diff --git a/src/command/FingerprintCommands.cxx b/src/command/FingerprintCommands.cxx
index be5aa3f2c..295795c95 100644
--- a/src/command/FingerprintCommands.cxx
+++ b/src/command/FingerprintCommands.cxx
@@ -305,7 +305,7 @@ GetChromaprintCommand::Read(InputStream &is, void *buffer, size_t length)
cond.wait(lock);
}
- return is.Read(buffer, length);
+ return is.Read(lock, buffer, length);
}
CommandResult