diff options
author | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-16 13:22:56 +0000 |
---|---|---|
committer | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-16 13:22:56 +0000 |
commit | 96cbd2c4d2ea7e138b65923a46fb77bc096a6782 (patch) | |
tree | 34f0bced44887d5d2fe07bfba5e484982af8bfc4 /include | |
parent | e3f84f3911d6ab1c99030fef3200199755251d51 (diff) |
Revert "Add a method to atomic add."
This reverts commit eb539cf92f487daf9567ffbbba6b6653406d43ae.
BUG=
TEST=
Review URL: https://codereview.appspot.com/6395051
git-svn-id: http://skia.googlecode.com/svn/trunk@4615 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkThread.h | 1 | ||||
-rw-r--r-- | include/core/SkThread_platform.h | 17 |
2 files changed, 2 insertions, 16 deletions
diff --git a/include/core/SkThread.h b/include/core/SkThread.h index 5b1fc1c213..2fd5052b06 100644 --- a/include/core/SkThread.h +++ b/include/core/SkThread.h @@ -16,7 +16,6 @@ /****** SkThread_platform needs to define the following... int32_t sk_atomic_inc(int32_t*); -int32_t sk_atomic_add(int32_t*, int32_t); int32_t sk_atomic_dec(int32_t*); int32_t sk_atomic_conditional_inc(int32_t*); diff --git a/include/core/SkThread_platform.h b/include/core/SkThread_platform.h index 19fcd4a743..cb05c50f3a 100644 --- a/include/core/SkThread_platform.h +++ b/include/core/SkThread_platform.h @@ -23,10 +23,6 @@ static inline __attribute__((always_inline)) int32_t sk_atomic_inc(int32_t *addr return __sync_fetch_and_add(addr, 1); } -static inline __attribute__((always_inline)) int32_t sk_atomic_add(int32_t *addr, int32_t value) { - return __sync_fetch_and_add(addr, value); -} - static inline __attribute__((always_inline)) int32_t sk_atomic_dec(int32_t *addr) { return __sync_fetch_and_add(addr, -1); } @@ -58,9 +54,8 @@ static inline __attribute__((always_inline)) void sk_membar_aquire__after_atomic */ #include <utils/Atomic.h> -#define sk_atomic_inc(addr) android_atomic_inc(addr) -#define sk_atomic_add(addr, value) android_atomic_add(value, addr) -#define sk_atomic_dec(addr) android_atomic_dec(addr) +#define sk_atomic_inc(addr) android_atomic_inc(addr) +#define sk_atomic_dec(addr) android_atomic_dec(addr) void sk_membar_aquire__after_atomic_dec() { //HACK: Android is actually using full memory barriers. // Should this change, uncomment below. @@ -97,14 +92,6 @@ void sk_membar_aquire__after_atomic_conditional_inc() { */ SK_API int32_t sk_atomic_inc(int32_t* addr); -/** Implemented by the porting layer, this function adds value to the int - specified by the address (in a thread-safe manner), and returns the - previous value. - No additional memory barrier is required. - This must act as a compiler barrier. - */ -SK_API int32_t sk_atomic_add(int32_t* addr, int32_t value); - /** Implemented by the porting layer, this function subtracts one from the int specified by the address (in a thread-safe manner), and returns the previous value. |