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

Unified Diff: include/core/SkThread.h

Issue 304593003: Add SkBarriers to ports. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix order 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
Index: include/core/SkThread.h
diff --git a/include/core/SkThread.h b/include/core/SkThread.h
index c8cd4e9112aad6492ece41d40c06ac8d628a8b37..9f32feb029c732bfa756932683ef60eb4652b94e 100644
--- a/include/core/SkThread.h
+++ b/include/core/SkThread.h
@@ -60,6 +60,19 @@ 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. */
+template <typename T> T sk_acquire_load(T*);
+
+/** Write T*, with at least a release barrier. */
+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 {

Powered by Google App Engine
This is Rietveld 408576698