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_DEFINED | 10 #ifndef SkThread_DEFINED |
11 #define SkThread_DEFINED | 11 #define SkThread_DEFINED |
12 | 12 |
13 #include "SkTypes.h" | 13 #include "SkTypes.h" |
14 #include "SkThread_platform.h" | 14 #include "SkThread_platform.h" |
15 | 15 |
16 /****** SkThread_platform needs to define the following... | 16 /****** SkThread_platform needs to define the following... |
17 | 17 |
18 int32_t sk_atomic_inc(int32_t*); | 18 int32_t sk_atomic_inc(int32_t*); |
19 int32_t sk_atomic_add(int32_t*, int32_t); | 19 int32_t sk_atomic_add(int32_t*, int32_t); |
20 int32_t sk_atomic_dec(int32_t*); | 20 int32_t sk_atomic_dec(int32_t*); |
21 int32_t sk_atomic_conditional_inc(int32_t*); | 21 int32_t sk_atomic_conditional_inc(int32_t*); |
| 22 int32_t sk_atomic_unprotected_read(const volatile int32_t &); |
22 | 23 |
23 class SkMutex { | 24 class SkMutex { |
24 public: | 25 public: |
25 SkMutex(); | 26 SkMutex(); |
26 ~SkMutex(); | 27 ~SkMutex(); |
27 | 28 |
28 void acquire(); | 29 void acquire(); |
29 void release(); | 30 void release(); |
30 }; | 31 }; |
31 | 32 |
(...skipping 27 matching lines...) Expand all Loading... |
59 fMutex->release(); | 60 fMutex->release(); |
60 fMutex = NULL; | 61 fMutex = NULL; |
61 } | 62 } |
62 } | 63 } |
63 | 64 |
64 private: | 65 private: |
65 SkBaseMutex* fMutex; | 66 SkBaseMutex* fMutex; |
66 }; | 67 }; |
67 | 68 |
68 #endif | 69 #endif |
OLD | NEW |