Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Side by Side Diff: include/ports/SkAtomics_atomic.h

Issue 896553002: Atomics overhaul. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: warning Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/core/SkThreadPriv.h ('k') | include/ports/SkAtomics_std.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « include/core/SkThreadPriv.h ('k') | include/ports/SkAtomics_std.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698