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

Unified Diff: include/core/SkThread_platform.h

Issue 18770007: Add a 'unique' method to SkRefCnt, document the usage, and add support. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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_platform.h
===================================================================
--- include/core/SkThread_platform.h (revision 10052)
+++ include/core/SkThread_platform.h (working copy)
@@ -88,6 +88,10 @@
#endif // SK_BUILD_FOR_ANDROID_FRAMEWORK
+int32_t sk_atomic_unprotected_read(const volatile int32_t & x) {
bsalomon 2013/07/15 13:04:08 We've got several implementations of this that are
bungeman-skia 2013/07/15 16:02:41 Yes, we need to clean this up in general. Note tha
+ return x;
+}
+
#else // !SK_BUILD_FOR_ANDROID
/** Implemented by the porting layer, this function adds one to the int
@@ -130,6 +134,12 @@
*/
SK_API void sk_membar_aquire__after_atomic_conditional_inc();
+/** Forces an atomic read of 'x' and marks the read as a benign race.
+ No additional memory barrier is required.
+ This does not need to act as a compiler barrier.
+*/
+SK_API int32_t sk_atomic_unprotected_read(const volatile int32_t & x);
+
#endif // !SK_BUILD_FOR_ANDROID
#ifdef SK_USE_POSIX_THREADS

Powered by Google App Engine
This is Rietveld 408576698