OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2006 The Android Open Source Project | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #include "SkThread.h" | |
9 | |
10 int32_t sk_atomic_inc(int32_t* addr) { | |
11 int32_t value = *addr; | |
12 *addr = value + 1; | |
13 return value; | |
14 } | |
15 | |
16 int32_t sk_atomic_add(int32_t* addr, int32_t inc) { | |
17 int32_t value = *addr; | |
18 *addr = value + inc; | |
19 return value; | |
20 } | |
21 | |
22 int32_t sk_atomic_dec(int32_t* addr) { | |
23 int32_t value = *addr; | |
24 *addr = value - 1; | |
25 return value; | |
26 } | |
27 void sk_membar_aquire__after_atomic_dec() { } | |
28 | |
29 int32_t sk_atomic_conditional_inc(int32_t* addr) { | |
30 int32_t value = *addr; | |
31 if (value != 0) ++*addr; | |
32 return value; | |
33 } | |
34 void sk_membar_aquire__after_atomic_conditional_inc() { } | |
35 | |
36 SkMutex::SkMutex() {} | |
37 | |
38 SkMutex::~SkMutex() {} | |
39 | |
40 #ifndef SK_USE_POSIX_THREADS | |
41 void SkMutex::acquire() {} | |
42 void SkMutex::release() {} | |
43 #endif | |
OLD | NEW |