From 5d6a8b384004e4ceaebc933973319d6a5e20ccea Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 22 Dec 2017 11:03:37 +0100 Subject: [PATCH] MusicPipe: lock the mutex in Peek() and GetSize() --- src/MusicPipe.hxx | 2 ++ 1 file changed, 2 insertions(+) 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 protect(mutex); return head; } @@ -120,6 +121,7 @@ public: */ gcc_pure unsigned GetSize() const noexcept { + const std::lock_guard protect(mutex); return size; }