Index: include/core/SkAtomics.h |
diff --git a/include/core/SkAtomics.h b/include/core/SkAtomics.h |
index 7c5294b76da582e56414cb2e7ab842d14e48b8fc..e947d1a9a47775d1673761ab9f29657cb2e757a0 100644 |
--- a/include/core/SkAtomics.h |
+++ b/include/core/SkAtomics.h |
@@ -57,6 +57,17 @@ public: |
sk_atomic_store(&fVal, val, mo); |
} |
+ // Alias for .load(sk_memory_order_seq_cst). |
+ operator T() const { |
+ return this->load(); |
+ } |
+ |
+ // Alias for .store(v, sk_memory_order_seq_cst). |
+ T operator=(const T& v) { |
+ this->store(v); |
+ return v; |
+ } |
+ |
T fetch_add(const T& val, sk_memory_order mo = sk_memory_order_seq_cst) { |
return sk_atomic_fetch_add(&fVal, val, mo); |
} |