| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 void DeferredTaskHandler::lock() | 37 void DeferredTaskHandler::lock() |
| 38 { | 38 { |
| 39 // Don't allow regular lock in real-time audio thread. | 39 // Don't allow regular lock in real-time audio thread. |
| 40 ASSERT(isMainThread()); | 40 ASSERT(isMainThread()); |
| 41 m_contextGraphMutex.lock(); | 41 m_contextGraphMutex.lock(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void DeferredTaskHandler::offlineContextLock() |
| 45 { |
| 46 ASSERT(!isMainThread()); |
| 47 m_contextGraphMutex.lock(); |
| 48 } |
| 49 |
| 44 bool DeferredTaskHandler::tryLock() | 50 bool DeferredTaskHandler::tryLock() |
| 45 { | 51 { |
| 46 // Try to catch cases of using try lock on main thread | 52 // Try to catch cases of using try lock on main thread |
| 47 // - it should use regular lock. | 53 // - it should use regular lock. |
| 48 ASSERT(isAudioThread()); | 54 ASSERT(isAudioThread()); |
| 49 if (!isAudioThread()) { | 55 if (!isAudioThread()) { |
| 50 // In release build treat tryLock() as lock() (since above | 56 // In release build treat tryLock() as lock() (since above |
| 51 // ASSERT(isAudioThread) never fires) - this is the best we can do. | 57 // ASSERT(isAudioThread) never fires) - this is the best we can do. |
| 52 lock(); | 58 lock(); |
| 53 return true; | 59 return true; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 { | 267 { |
| 262 ASSERT(isMainThread()); | 268 ASSERT(isMainThread()); |
| 263 AutoLocker locker(*this); | 269 AutoLocker locker(*this); |
| 264 m_renderingOrphanHandlers.clear(); | 270 m_renderingOrphanHandlers.clear(); |
| 265 m_deletableOrphanHandlers.clear(); | 271 m_deletableOrphanHandlers.clear(); |
| 266 } | 272 } |
| 267 | 273 |
| 268 } // namespace blink | 274 } // namespace blink |
| 269 | 275 |
| 270 #endif // ENABLE(WEB_AUDIO) | 276 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |