summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-12-22 11:03:37 +0100
committerMax Kellermann <max@musicpd.org>2018-01-07 17:20:22 +0100
commit4bb89b1755d115aba6f4411c5de627db8801af72 (patch)
tree4e6c66d516804a1662c2209dddbc032d3ae06ad1 /src
parent0ef553d30eda28f08e74ae422e5ba5b13cd1a03f (diff)
MusicPipe: lock the mutex in Peek() and GetSize()
Diffstat (limited to 'src')
-rw-r--r--src/MusicPipe.hxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/MusicPipe.hxx b/src/MusicPipe.hxx
index f9e42326b..ecb923431 100644
--- a/src/MusicPipe.hxx
+++ b/src/MusicPipe.hxx
@@ -95,6 +95,7 @@ public:
*/
gcc_pure
const MusicChunk *Peek() const noexcept {
+ const std::lock_guard<Mutex> protect(mutex);
return head;
}
@@ -120,6 +121,7 @@ public:
*/
gcc_pure
unsigned GetSize() const noexcept {
+ const std::lock_guard<Mutex> protect(mutex);
return size;
}