| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 bool isAudioThread() const { return currentThread() == acquireLoad(&m_audioT
hread); } | 115 bool isAudioThread() const { return currentThread() == acquireLoad(&m_audioT
hread); } |
| 116 | 116 |
| 117 void lock(); | 117 void lock(); |
| 118 bool tryLock(); | 118 bool tryLock(); |
| 119 void unlock(); | 119 void unlock(); |
| 120 | 120 |
| 121 // This locks the audio render thread for OfflineAudioContext rendering. | 121 // This locks the audio render thread for OfflineAudioContext rendering. |
| 122 // MUST NOT be used in the real-time audio context. | 122 // MUST NOT be used in the real-time audio context. |
| 123 void offlineLock(); | 123 void offlineLock(); |
| 124 | 124 |
| 125 #if ENABLE(ASSERT) |
| 125 // Returns true if this thread owns the context's lock. | 126 // Returns true if this thread owns the context's lock. |
| 126 bool isGraphOwner(); | 127 bool isGraphOwner(); |
| 128 #endif |
| 127 | 129 |
| 128 class MODULES_EXPORT AutoLocker { | 130 class MODULES_EXPORT AutoLocker { |
| 129 STACK_ALLOCATED(); | 131 STACK_ALLOCATED(); |
| 130 public: | 132 public: |
| 131 explicit AutoLocker(DeferredTaskHandler& handler) | 133 explicit AutoLocker(DeferredTaskHandler& handler) |
| 132 : m_handler(handler) | 134 : m_handler(handler) |
| 133 { | 135 { |
| 134 m_handler.lock(); | 136 m_handler.lock(); |
| 135 } | 137 } |
| 136 explicit AutoLocker(AbstractAudioContext*); | 138 explicit AutoLocker(AbstractAudioContext*); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 Vector<RefPtr<AudioHandler>> m_deletableOrphanHandlers; | 195 Vector<RefPtr<AudioHandler>> m_deletableOrphanHandlers; |
| 194 | 196 |
| 195 // Graph locking. | 197 // Graph locking. |
| 196 RecursiveMutex m_contextGraphMutex; | 198 RecursiveMutex m_contextGraphMutex; |
| 197 volatile ThreadIdentifier m_audioThread; | 199 volatile ThreadIdentifier m_audioThread; |
| 198 }; | 200 }; |
| 199 | 201 |
| 200 } // namespace blink | 202 } // namespace blink |
| 201 | 203 |
| 202 #endif // DeferredTaskHandler_h | 204 #endif // DeferredTaskHandler_h |
| OLD | NEW |