Commit 813567bf authored by Max Kellermann's avatar Max Kellermann

input/buffering: use notify_one() to wake up thread

There is just one thread.
parent 16a07bc2
...@@ -39,7 +39,7 @@ BufferingInputStream::~BufferingInputStream() noexcept ...@@ -39,7 +39,7 @@ BufferingInputStream::~BufferingInputStream() noexcept
{ {
const std::lock_guard<Mutex> lock(mutex); const std::lock_guard<Mutex> lock(mutex);
stop = true; stop = true;
wake_cond.notify_all(); wake_cond.notify_one();
} }
thread.Join(); thread.Join();
...@@ -73,7 +73,7 @@ BufferingInputStream::Seek(std::unique_lock<Mutex> &lock, size_t new_offset) ...@@ -73,7 +73,7 @@ BufferingInputStream::Seek(std::unique_lock<Mutex> &lock, size_t new_offset)
seek_offset = new_offset; seek_offset = new_offset;
seek = true; seek = true;
wake_cond.notify_all(); wake_cond.notify_one();
client_cond.wait(lock, [this]{ return !seek; }); client_cond.wait(lock, [this]{ return !seek; });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment