// 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
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);
}
acquire_barrier();
}
-#undef ANNOTATE_BENIGN_RACE
+#undef SK_ANNOTATE_BENIGN_RACE
#endif // SkOnce_DEFINED