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

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

Issue 23926002: Fix threading races on ConvolverNode::m_reverb in ConvolverNode::tailTime() (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..fcea79f64ca104fcf50c8591aea69b1390de7455 100644
--- a/Source/modules/webaudio/ConvolverNode.cpp
+++ b/Source/modules/webaudio/ConvolverNode.cpp
@@ -158,7 +158,12 @@ AudioBuffer* ConvolverNode::buffer()
double ConvolverNode::tailTime() const
{
- return m_reverb ? m_reverb->impulseResponseLength() / static_cast<double>(sampleRate()) : 0;
+ MutexTryLocker tryLocker(m_processLock);
+ if (tryLocker.locked())
+ return m_reverb ? m_reverb->impulseResponseLength() / 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();
}
double ConvolverNode::latencyTime() const
« 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