Commit f88f1fca authored by Max Kellermann's avatar Max Kellermann

output/httpd: move Close() lock into the I/O thread

Fixes a potential deadlock introduced by commit 94528735
parent 26e4a40c
...@@ -266,14 +266,13 @@ HttpdOutput::Open(AudioFormat &audio_format) ...@@ -266,14 +266,13 @@ HttpdOutput::Open(AudioFormat &audio_format)
inline void inline void
HttpdOutput::Close() HttpdOutput::Close()
{ {
const std::lock_guard<Mutex> protect(mutex);
assert(open); assert(open);
open = false;
delete timer; delete timer;
BlockingCall(GetEventLoop(), [this](){ BlockingCall(GetEventLoop(), [this](){
const std::lock_guard<Mutex> protect(mutex);
open = false;
clients.clear_and_dispose(DeleteDisposer()); clients.clear_and_dispose(DeleteDisposer());
}); });
......
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