Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2108)

Unified Diff: Source/modules/webaudio/ConvolverNode.cpp

Issue 23514037: Fix threading races on ConvolverNode::m_reverb in ConvolverNode::latencyFrames() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/ConvolverNode.cpp
diff --git a/Source/modules/webaudio/ConvolverNode.cpp b/Source/modules/webaudio/ConvolverNode.cpp
index 36a473f5f4f58cc6649a429c2af5f1f7903032cf..1b125835e673c9817518d82e5af694a2622ded2a 100644
--- a/Source/modules/webaudio/ConvolverNode.cpp
+++ b/Source/modules/webaudio/ConvolverNode.cpp
@@ -163,7 +163,12 @@ double ConvolverNode::tailTime() const
double ConvolverNode::latencyTime() const
{
- return m_reverb ? m_reverb->latencyFrames() / static_cast<double>(sampleRate()) : 0;
+ MutexTryLocker tryLocker(m_processLock);
+ if (tryLocker.locked())
+ return m_reverb ? m_reverb->latencyFrames() / static_cast<double>(sampleRate()) : 0;
+ // Since we don't want to block the Audio Device thread, we return a large value
+ // instead of trying to acquire the lock.
+ return std::numeric_limits<double>::infinity();
}
} // namespace WebCore
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698