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 | |
50 bool DeferredTaskHandler::tryLock() | 44 bool DeferredTaskHandler::tryLock() |
51 { | 45 { |
52 // Try to catch cases of using try lock on main thread | 46 // Try to catch cases of using try lock on main thread |
53 // - it should use regular lock. | 47 // - it should use regular lock. |
54 ASSERT(isAudioThread()); | 48 ASSERT(isAudioThread()); |
55 if (!isAudioThread()) { | 49 if (!isAudioThread()) { |
56 // In release build treat tryLock() as lock() (since above | 50 // In release build treat tryLock() as lock() (since above |
57 // ASSERT(isAudioThread) never fires) - this is the best we can do. | 51 // ASSERT(isAudioThread) never fires) - this is the best we can do. |
58 lock(); | 52 lock(); |
59 return true; | 53 return true; |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 { | 261 { |
268 ASSERT(isMainThread()); | 262 ASSERT(isMainThread()); |
269 AutoLocker locker(*this); | 263 AutoLocker locker(*this); |
270 m_renderingOrphanHandlers.clear(); | 264 m_renderingOrphanHandlers.clear(); |
271 m_deletableOrphanHandlers.clear(); | 265 m_deletableOrphanHandlers.clear(); |
272 } | 266 } |
273 | 267 |
274 } // namespace blink | 268 } // namespace blink |
275 | 269 |
276 #endif // ENABLE(WEB_AUDIO) | 270 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |