OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 | 7 |
9 | |
10 #include "SkThread.h" | 8 #include "SkThread.h" |
11 #include "SkTLS.h" | |
12 | 9 |
13 int32_t sk_atomic_inc(int32_t* addr) { | 10 int32_t sk_atomic_inc(int32_t* addr) { |
14 int32_t value = *addr; | 11 int32_t value = *addr; |
15 *addr = value + 1; | 12 *addr = value + 1; |
16 return value; | 13 return value; |
17 } | 14 } |
18 | 15 |
19 int32_t sk_atomic_add(int32_t* addr, int32_t inc) { | 16 int32_t sk_atomic_add(int32_t* addr, int32_t inc) { |
20 int32_t value = *addr; | 17 int32_t value = *addr; |
21 *addr = value + inc; | 18 *addr = value + inc; |
(...skipping 15 matching lines...) Expand all Loading... |
37 void sk_membar_aquire__after_atomic_conditional_inc() { } | 34 void sk_membar_aquire__after_atomic_conditional_inc() { } |
38 | 35 |
39 SkMutex::SkMutex() {} | 36 SkMutex::SkMutex() {} |
40 | 37 |
41 SkMutex::~SkMutex() {} | 38 SkMutex::~SkMutex() {} |
42 | 39 |
43 #ifndef SK_USE_POSIX_THREADS | 40 #ifndef SK_USE_POSIX_THREADS |
44 void SkMutex::acquire() {} | 41 void SkMutex::acquire() {} |
45 void SkMutex::release() {} | 42 void SkMutex::release() {} |
46 #endif | 43 #endif |
47 | |
48 ////////////////////////////////////////////////////////////////////////// | |
49 | |
50 static void* gSpecific; | |
51 | |
52 void* SkTLS::PlatformGetSpecific(bool) { | |
53 return gSpecific; | |
54 } | |
55 | |
56 void SkTLS::PlatformSetSpecific(void* ptr) { | |
57 gSpecific = ptr; | |
58 } | |
OLD | NEW |