Commit c017b5d0 authored by olka's avatar olka Committed by Commit bot

Fixing deadlock by removing unnesessary lock in AudioRendererMixer

Deadlock is like this:

On main or media thread:
ARMM::GetOutputDeviceInfo [takes |lock_|]
-> AOD::GetOutputDeviceInfo -> waits for device authorization, which can be signalled on IO thread only

On IO thread:
AOD::CreateStreamOnIOThread/OnStateChanged*
-> ARMM::OnRenderError [takes |lock_|],
so OnDeviceAuthorized/OnIPCClosed will never be called and device authorization will never be signalled.

*AOD::OnDeviceAuthorized itself does not deadlock it always signals event before calling OnRenderError()

That lock in ARMM::GetOutputDeviceInfo is never needed, after all

BUG=615589

Review-Url: https://codereview.chromium.org/2085603002
Cr-Commit-Position: refs/heads/master@{#400735}
parent 47f99fae
...@@ -115,7 +115,6 @@ void AudioRendererMixer::RemoveErrorCallback(const base::Closure& error_cb) { ...@@ -115,7 +115,6 @@ void AudioRendererMixer::RemoveErrorCallback(const base::Closure& error_cb) {
OutputDeviceInfo AudioRendererMixer::GetOutputDeviceInfo() { OutputDeviceInfo AudioRendererMixer::GetOutputDeviceInfo() {
DVLOG(1) << __FUNCTION__; DVLOG(1) << __FUNCTION__;
base::AutoLock auto_lock(lock_);
return audio_sink_->GetOutputDeviceInfo(); return audio_sink_->GetOutputDeviceInfo();
} }
......
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