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

Unified Diff: include/core/SkAtomics.h

Issue 896803002: Port SkRefCnt.h to new SkAtomics.h (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/core/SkRefCnt.h » ('j') | include/core/SkRefCnt.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkAtomics.h
diff --git a/include/core/SkAtomics.h b/include/core/SkAtomics.h
index 1a84049970ddbe97ce8fdca5c890080ee27d64c9..e62d6e093155204dbbae14c3ccb9b7fe2d24eddf 100644
--- a/include/core/SkAtomics.h
+++ b/include/core/SkAtomics.h
@@ -34,6 +34,11 @@ bool sk_atomic_compare_exchange(T*, T* expected, T desired,
#include "../ports/SkAtomics_sync.h"
#endif
+inline void sk_memory_barrier(sk_memory_order mo) {
+ int junk;
+ (void)sk_atomic_fetch_add(&junk, 42, mo);
+}
+
// From here down we have shims for our old atomics API, to be weaned off of.
// We use the default sequentially-consistent memory order to make things simple
// and to match the practical reality of our old _sync and _win implementations.
« no previous file with comments | « no previous file | include/core/SkRefCnt.h » ('j') | include/core/SkRefCnt.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698