Index: include/ports/SkAtomics_sync.h |
diff --git a/include/ports/SkAtomics_sync.h b/include/ports/SkAtomics_sync.h |
index 7ca0b46a94a6b23f95e60d7d57109cb3325d8167..02b1e580725d9f949ded0b3c6861f07de16fa8dc 100644 |
--- a/include/ports/SkAtomics_sync.h |
+++ b/include/ports/SkAtomics_sync.h |
@@ -46,6 +46,11 @@ T sk_atomic_fetch_add(T* ptr, T val, sk_memory_order) { |
} |
template <typename T> |
+T sk_atomic_fetch_sub(T* ptr, T val, sk_memory_order) { |
+ return __sync_fetch_and_sub(ptr, val); |
+} |
+ |
+template <typename T> |
bool sk_atomic_compare_exchange(T* ptr, T* expected, T desired, sk_memory_order, sk_memory_order) { |
T prev = __sync_val_compare_and_swap(ptr, *expected, desired); |
if (prev == *expected) { |