aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/ports/SkAtomics_atomic.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ports/SkAtomics_atomic.h')
-rw-r--r--include/ports/SkAtomics_atomic.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/ports/SkAtomics_atomic.h b/include/ports/SkAtomics_atomic.h
index ddbf7c3f37..64ee823f90 100644
--- a/include/ports/SkAtomics_atomic.h
+++ b/include/ports/SkAtomics_atomic.h
@@ -32,6 +32,12 @@ T sk_atomic_fetch_add(T* ptr, T val, sk_memory_order mo) {
}
template <typename T>
+T sk_atomic_fetch_sub(T* ptr, T val, sk_memory_order mo) {
+ // All values of mo are valid.
+ return __atomic_fetch_sub(ptr, val, mo);
+}
+
+template <typename T>
bool sk_atomic_compare_exchange(T* ptr, T* expected, T desired,
sk_memory_order success,
sk_memory_order failure) {