OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkThread_platform_DEFINED | 10 #ifndef SkThread_platform_DEFINED |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 pthread_mutex_t fMutex; | 147 pthread_mutex_t fMutex; |
148 }; | 148 }; |
149 | 149 |
150 // Using POD-style initialization prevents the generation of a static initialize
r | 150 // Using POD-style initialization prevents the generation of a static initialize
r |
151 // and keeps the acquire() implementation small and fast. | 151 // and keeps the acquire() implementation small and fast. |
152 #define SK_DECLARE_STATIC_MUTEX(name) static SkBaseMutex name = { PTHREAD_MUT
EX_INITIALIZER } | 152 #define SK_DECLARE_STATIC_MUTEX(name) static SkBaseMutex name = { PTHREAD_MUT
EX_INITIALIZER } |
153 | 153 |
154 // Special case used when the static mutex must be available globally. | 154 // Special case used when the static mutex must be available globally. |
155 #define SK_DECLARE_GLOBAL_MUTEX(name) SkBaseMutex name = { PTHREAD_MUTEX_INIT
IALIZER } | 155 #define SK_DECLARE_GLOBAL_MUTEX(name) SkBaseMutex name = { PTHREAD_MUTEX_INIT
IALIZER } |
156 | 156 |
157 #define SK_DECLARE_MUTEX_ARRAY(name, count) SkBaseMutex name[count] = { { PTH
READ_MUTEX_INITIALIZER } } | |
158 | |
159 // A normal mutex that requires to be initialized through normal C++ constructio
n, | 157 // A normal mutex that requires to be initialized through normal C++ constructio
n, |
160 // i.e. when it's a member of another class, or allocated on the heap. | 158 // i.e. when it's a member of another class, or allocated on the heap. |
161 class SK_API SkMutex : public SkBaseMutex, SkNoncopyable { | 159 class SK_API SkMutex : public SkBaseMutex, SkNoncopyable { |
162 public: | 160 public: |
163 SkMutex(); | 161 SkMutex(); |
164 ~SkMutex(); | 162 ~SkMutex(); |
165 }; | 163 }; |
166 | 164 |
167 #else // !SK_USE_POSIX_THREADS | 165 #else // !SK_USE_POSIX_THREADS |
168 | 166 |
(...skipping 13 matching lines...) Expand all Loading... |
182 enum { | 180 enum { |
183 kStorageIntCount = 64 | 181 kStorageIntCount = 64 |
184 }; | 182 }; |
185 uint32_t fStorage[kStorageIntCount]; | 183 uint32_t fStorage[kStorageIntCount]; |
186 }; | 184 }; |
187 | 185 |
188 typedef SkMutex SkBaseMutex; | 186 typedef SkMutex SkBaseMutex; |
189 | 187 |
190 #define SK_DECLARE_STATIC_MUTEX(name) static SkBaseMutex name | 188 #define SK_DECLARE_STATIC_MUTEX(name) static SkBaseMutex name |
191 #define SK_DECLARE_GLOBAL_MUTEX(name) SkBaseMutex name | 189 #define SK_DECLARE_GLOBAL_MUTEX(name) SkBaseMutex name |
192 #define SK_DECLARE_MUTEX_ARRAY(name, count) SkBaseMutex name[count] | |
193 | 190 |
194 #endif // !SK_USE_POSIX_THREADS | 191 #endif // !SK_USE_POSIX_THREADS |
195 | 192 |
196 | 193 |
197 #endif | 194 #endif |
OLD | NEW |