| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 SkThread_DEFINED | 8 #ifndef SkThread_DEFINED |
| 9 #define SkThread_DEFINED | 9 #define SkThread_DEFINED |
| 10 | 10 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 void assertHeld(); // If SK_DEBUG, assert this thread owns the mutex. | 89 void assertHeld(); // If SK_DEBUG, assert this thread owns the mutex. |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 class SkMutex : SkBaseMutex { | 92 class SkMutex : SkBaseMutex { |
| 93 public: | 93 public: |
| 94 SkMutex(); | 94 SkMutex(); |
| 95 ~SkMutex(); | 95 ~SkMutex(); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 #define SK_DECLARE_STATIC_MUTEX(name) static SkBaseMutex name = ... | 98 #define SK_DECLARE_STATIC_MUTEX(name) static SkBaseMutex name = ... |
| 99 #define SK_DECLARE_GLOBAL_MUTEX(name) SkBaseMutex name = ... | |
| 100 */ | 99 */ |
| 101 | 100 |
| 102 #include SK_MUTEX_PLATFORM_H | 101 #include SK_MUTEX_PLATFORM_H |
| 103 | 102 |
| 104 | 103 |
| 105 class SkAutoMutexAcquire : SkNoncopyable { | 104 class SkAutoMutexAcquire : SkNoncopyable { |
| 106 public: | 105 public: |
| 107 explicit SkAutoMutexAcquire(SkBaseMutex& mutex) : fMutex(&mutex) { | 106 explicit SkAutoMutexAcquire(SkBaseMutex& mutex) : fMutex(&mutex) { |
| 108 SkASSERT(fMutex != NULL); | 107 SkASSERT(fMutex != NULL); |
| 109 mutex.acquire(); | 108 mutex.acquire(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 135 SkASSERT(fMutex); | 134 SkASSERT(fMutex); |
| 136 fMutex->assertHeld(); | 135 fMutex->assertHeld(); |
| 137 } | 136 } |
| 138 | 137 |
| 139 private: | 138 private: |
| 140 SkBaseMutex* fMutex; | 139 SkBaseMutex* fMutex; |
| 141 }; | 140 }; |
| 142 #define SkAutoMutexAcquire(...) SK_REQUIRE_LOCAL_VAR(SkAutoMutexAcquire) | 141 #define SkAutoMutexAcquire(...) SK_REQUIRE_LOCAL_VAR(SkAutoMutexAcquire) |
| 143 | 142 |
| 144 #endif | 143 #endif |
| OLD | NEW |