Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkSharedLock_DEFINED | 8 #ifndef SkSharedLock_DEFINED |
| 9 #define SkSharedLock_DEFINED | 9 #define SkSharedLock_DEFINED |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 SkSemaphore fSharedQueue; | 62 SkSemaphore fSharedQueue; |
| 63 SkSemaphore fExclusiveQueue; | 63 SkSemaphore fExclusiveQueue; |
| 64 #endif // SK_DEBUG | 64 #endif // SK_DEBUG |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 #ifndef SK_DEBUG | 67 #ifndef SK_DEBUG |
| 68 inline void SkSharedMutex::assertHeld() const {}; | 68 inline void SkSharedMutex::assertHeld() const {}; |
| 69 inline void SkSharedMutex::assertHeldShared() const {}; | 69 inline void SkSharedMutex::assertHeldShared() const {}; |
| 70 #endif // SK_DEBUG | 70 #endif // SK_DEBUG |
| 71 | 71 |
| 72 class SkAutoSharedMutexShared { | |
|
bungeman-skia
2015/10/21 21:19:09
After some thinking about it I do get the name, bu
| |
| 73 public: | |
| 74 SkAutoSharedMutexShared(SkSharedMutex& lock) : fLock(lock) { lock.acquireSha red(); } | |
| 75 ~SkAutoSharedMutexShared() { fLock.releaseShared(); } | |
| 76 private: | |
| 77 SkSharedMutex& fLock; | |
| 78 }; | |
| 79 | |
| 80 #define SkAutoSharedMutexShared(...) SK_REQUIRE_LOCAL_VAR(SkAutoSharedMutexShare d) | |
| 81 | |
| 72 #endif // SkSharedLock_DEFINED | 82 #endif // SkSharedLock_DEFINED |
| OLD | NEW |