MusicPipe: lock the mutex in Peek() and GetSize()

This commit is contained in:
Max Kellermann 2017-12-22 11:03:37 +01:00
parent 6a8c2848f6
commit 5d6a8b3840

View File

@ -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;
}