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

Unified Diff: include/core/SkThread.h

Issue 304593003: Add SkBarriers to ports. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more docs Created 6 years, 7 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 | « include/core/SkPostConfig.h ('k') | src/ports/SkBarriers_arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkThread.h
diff --git a/include/core/SkThread.h b/include/core/SkThread.h
index c8cd4e9112aad6492ece41d40c06ac8d628a8b37..3038e2d9542325503295f7603fd60b45b4fca80f 100644
--- a/include/core/SkThread.h
+++ b/include/core/SkThread.h
@@ -60,6 +60,25 @@ static inline int32_t sk_atomic_conditional_inc(int32_t* addr) {
return prev;
}
+// SK_BARRIERS_PLATFORM_H must provide implementations for the following declarations:
+
+/** Prevent the compiler from reordering across this barrier. */
+static void sk_compiler_barrier();
+
+/** Read T*, with at least an acquire barrier.
+ *
+ * Only needs to be implemented for T which can be atomically read.
+ */
+template <typename T> T sk_acquire_load(T*);
+
+/** Write T*, with at least a release barrier.
+ *
+ * Only needs to be implemented for T which can be atomically written.
+ */
+template <typename T> void sk_release_store(T*, T);
+
+#include SK_BARRIERS_PLATFORM_H
+
/** SK_MUTEX_PLATFORM_H must provide the following (or equivalent) declarations.
class SkBaseMutex {
« no previous file with comments | « include/core/SkPostConfig.h ('k') | src/ports/SkBarriers_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698