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 |