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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 ThreadIdentifier audioThread() const { return acquireLoad(&m_audioThread); } | 101 ThreadIdentifier audioThread() const { return acquireLoad(&m_audioThread); } |
102 | 102 |
103 // TODO(hongchan): Use no-barrier load here. (crbug.com/247328) | 103 // TODO(hongchan): Use no-barrier load here. (crbug.com/247328) |
104 // | 104 // |
105 // It is okay to use a relaxed (no-barrier) load here. Because the data | 105 // It is okay to use a relaxed (no-barrier) load here. Because the data |
106 // referenced by m_audioThread is not actually being used, thus we do not | 106 // referenced by m_audioThread is not actually being used, thus we do not |
107 // need a barrier between the load of m_audioThread and of that data. | 107 // need a barrier between the load of m_audioThread and of that data. |
108 bool isAudioThread() const { return currentThread() == acquireLoad(&m_audioT
hread); } | 108 bool isAudioThread() const { return currentThread() == acquireLoad(&m_audioT
hread); } |
109 | 109 |
110 void lock(); | 110 void lock(); |
| 111 void forceLock(); |
111 bool tryLock(); | 112 bool tryLock(); |
112 void unlock(); | 113 void unlock(); |
113 #if ENABLE(ASSERT) | 114 #if ENABLE(ASSERT) |
114 // Returns true if this thread owns the context's lock. | 115 // Returns true if this thread owns the context's lock. |
115 bool isGraphOwner(); | 116 bool isGraphOwner(); |
116 #endif | 117 #endif |
117 | 118 |
118 class MODULES_EXPORT AutoLocker { | 119 class MODULES_EXPORT AutoLocker { |
119 STACK_ALLOCATED(); | 120 STACK_ALLOCATED(); |
120 public: | 121 public: |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 Vector<RefPtr<AudioHandler>> m_deletableOrphanHandlers; | 166 Vector<RefPtr<AudioHandler>> m_deletableOrphanHandlers; |
166 | 167 |
167 // Graph locking. | 168 // Graph locking. |
168 RecursiveMutex m_contextGraphMutex; | 169 RecursiveMutex m_contextGraphMutex; |
169 volatile ThreadIdentifier m_audioThread; | 170 volatile ThreadIdentifier m_audioThread; |
170 }; | 171 }; |
171 | 172 |
172 } // namespace blink | 173 } // namespace blink |
173 | 174 |
174 #endif // DeferredTaskHandler_h | 175 #endif // DeferredTaskHandler_h |
OLD | NEW |