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

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

Issue 24123002: Merge 157245 "Fix threading races on ConvolverNode::m_reverb in ..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1599/
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
===================================================================
--- Source/modules/webaudio/ConvolverNode.cpp (revision 157689)
+++ Source/modules/webaudio/ConvolverNode.cpp (working copy)
@@ -163,7 +163,12 @@
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