From e3ef3e8d715d34977c12fb17266719318c16bd6f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 4 Jan 2018 08:40:53 +0100 Subject: [PATCH] output/Control: unlock mutex during expensive operations --- src/output/Control.cxx | 1 + src/output/Thread.cxx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/output/Control.cxx b/src/output/Control.cxx index ec0430a1e..2edcd7ca5 100644 --- a/src/output/Control.cxx +++ b/src/output/Control.cxx @@ -226,6 +226,7 @@ AudioOutputControl::Open(const AudioFormat audio_format, const bool open2 = open; if (open2 && output->mixer != nullptr) { + const ScopeUnlock unlock(mutex); try { mixer_open(output->mixer); } catch (...) { diff --git a/src/output/Thread.cxx b/src/output/Thread.cxx index c8e90f726..3fb17ae54 100644 --- a/src/output/Thread.cxx +++ b/src/output/Thread.cxx @@ -501,5 +501,6 @@ AudioOutputControl::StartThread() { assert(command == Command::NONE); + const ScopeUnlock unlock(mutex); thread.Start(); }