From 813567bf5c1cd7fa147abe9bf771aa0a30f34430 Mon Sep 17 00:00:00 2001 From: Max Kellermann <max@musicpd.org> Date: Fri, 17 May 2019 11:57:23 +0200 Subject: [PATCH] input/buffering: use notify_one() to wake up thread There is just one thread. --- src/input/BufferingInputStream.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/input/BufferingInputStream.cxx b/src/input/BufferingInputStream.cxx index 50467e844..220d0f5ff 100644 --- a/src/input/BufferingInputStream.cxx +++ b/src/input/BufferingInputStream.cxx @@ -39,7 +39,7 @@ BufferingInputStream::~BufferingInputStream() noexcept { const std::lock_guard<Mutex> lock(mutex); stop = true; - wake_cond.notify_all(); + wake_cond.notify_one(); } thread.Join(); @@ -73,7 +73,7 @@ BufferingInputStream::Seek(std::unique_lock<Mutex> &lock, size_t new_offset) seek_offset = new_offset; seek = true; - wake_cond.notify_all(); + wake_cond.notify_one(); client_cond.wait(lock, [this]{ return !seek; });