Chromium Code Reviews| Index: Source/modules/webaudio/DeferredTaskHandler.cpp |
| diff --git a/Source/modules/webaudio/DeferredTaskHandler.cpp b/Source/modules/webaudio/DeferredTaskHandler.cpp |
| index c2605c157caa2787a5da09895322d8aa52a7ff66..7b635016c2b10687d0001547dd8a9bc2428aaf6b 100644 |
| --- a/Source/modules/webaudio/DeferredTaskHandler.cpp |
| +++ b/Source/modules/webaudio/DeferredTaskHandler.cpp |
| @@ -42,6 +42,19 @@ void DeferredTaskHandler::lock() |
| m_contextGraphMutex.lock(); |
| } |
| +void DeferredTaskHandler::forceLock() |
| +{ |
| + // This allows the regular lock in non-real-time audio thread. |
| + ASSERT(!isMainThread()); |
|
Raymond Toy
2015/06/12 21:11:36
According to the comment, this is for a non-real-t
hongchan
2015/06/15 18:40:46
We can't use |isOfflineContext()| here. DTHandler
|
| + if (isMainThread()) { |
| + // If this gets called in the main thread, do tryLock() instead. |
| + m_contextGraphMutex.tryLock(); |
| + return; |
| + } |
| + |
| + m_contextGraphMutex.lock(); |
| +} |
| + |
| bool DeferredTaskHandler::tryLock() |
| { |
| // Try to catch cases of using try lock on main thread |