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

Unified Diff: include/core/SkOnce.h

Issue 144063002: Scope our ANNOTATE_BENIGN_RACE. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkOnce.h
diff --git a/include/core/SkOnce.h b/include/core/SkOnce.h
index 78fd7007b05a9443f017933977f2c0c370b52e7d..9c4ccd49d06ab403b1cebbc0f77e25cec4cca1c3 100644
--- a/include/core/SkOnce.h
+++ b/include/core/SkOnce.h
@@ -112,7 +112,7 @@ static void sk_once_slow(SkOnceFlag* once, Func f, Arg arg) {
// We nabbed this code from the dynamic_annotations library, and in their honor
// we check the same define. If you find yourself wanting more than just
-// ANNOTATE_BENIGN_RACE, it might make sense to pull that in as a dependency
+// SK_ANNOTATE_BENIGN_RACE, it might make sense to pull that in as a dependency
// rather than continue to reproduce it here.
#if DYNAMIC_ANNOTATIONS_ENABLED
@@ -120,15 +120,15 @@ static void sk_once_slow(SkOnceFlag* once, Func f, Arg arg) {
extern "C" {
void AnnotateBenignRace(const char* file, int line, const volatile void* mem, const char* desc);
}
-#define ANNOTATE_BENIGN_RACE(mem, desc) AnnotateBenignRace(__FILE__, __LINE__, mem, desc)
+#define SK_ANNOTATE_BENIGN_RACE(mem, desc) AnnotateBenignRace(__FILE__, __LINE__, mem, desc)
#else
-#define ANNOTATE_BENIGN_RACE(mem, desc)
+#define SK_ANNOTATE_BENIGN_RACE(mem, desc)
#endif
// This is our fast path, called all the time. We do really want it to be inlined.
template <typename Func, typename Arg>
inline void SkOnce(SkOnceFlag* once, Func f, Arg arg) {
- ANNOTATE_BENIGN_RACE(&(once->done), "Don't worry TSAN, we're sure this is safe.");
+ SK_ANNOTATE_BENIGN_RACE(&(once->done), "Don't worry TSAN, we're sure this is safe.");
if (!once->done) {
sk_once_slow(once, f, arg);
}
@@ -145,6 +145,6 @@ inline void SkOnce(SkOnceFlag* once, Func f, Arg arg) {
acquire_barrier();
}
-#undef ANNOTATE_BENIGN_RACE
+#undef SK_ANNOTATE_BENIGN_RACE
#endif // SkOnce_DEFINED
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698