diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkAtomics.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/core/SkAtomics.h b/include/core/SkAtomics.h index 7c5294b76d..e947d1a9a4 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); } |