OLD | NEW |
(Empty) | |
| 1 #ifndef SkAtomics_atomic_DEFINED |
| 2 #define SkAtomics_atomic_DEFINED |
| 3 |
| 4 template <typename T> |
| 5 T sk_atomic_load(const T* ptr, sk_memory_order mo) { |
| 6 return __atomic_load_n(ptr, mo); |
| 7 } |
| 8 |
| 9 template <typename T> |
| 10 void sk_atomic_store(T* ptr, T val, sk_memory_order mo) { |
| 11 __atomic_store_n(ptr, val, mo); |
| 12 } |
| 13 |
| 14 template <typename T> |
| 15 T sk_atomic_fetch_add(T* ptr, T val, sk_memory_order mo) { |
| 16 return __atomic_fetch_add(ptr, val, mo); |
| 17 } |
| 18 |
| 19 template <typename T> |
| 20 bool sk_atomic_compare_exchange(T* ptr, T* expected, T desired, |
| 21 sk_memory_order success, |
| 22 sk_memory_order failure) { |
| 23 return __atomic_compare_exchange_n(ptr, expected, desired, false/*weak?*/, s
uccess, failure); |
| 24 } |
| 25 |
| 26 #endif//SkAtomics_atomic_DEFINED |
OLD | NEW |