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

Unified Diff: src/core/SkTraceEvent.h

Issue 702883002: Whitelist intentionally racy TRACE_EVENT reads and writes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: this volatile makes no sense. Created 6 years, 1 month 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 | « include/core/SkDynamicAnnotations.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTraceEvent.h
diff --git a/src/core/SkTraceEvent.h b/src/core/SkTraceEvent.h
index 34e3adf0eda329b0be187c4b43025d9d940355ce..2c3c9b41819be2851a4608b9b08d4e9bb42a9ee4 100644
--- a/src/core/SkTraceEvent.h
+++ b/src/core/SkTraceEvent.h
@@ -162,6 +162,7 @@
#define SkTraceEvent_DEFINED
#include "SkEventTracer.h"
+#include "SkDynamicAnnotations.h"
// By default, const char* argument values are assumed to have long-lived scope
// and will not be copied. Use this macro to force a const char* to be copied.
@@ -764,10 +765,12 @@
// write here because it's not strictly needed for correctness.
// So says Nat.
// FIXME
+//
+// Skia addition: we mark these as unprotected reads and writes to shut up TSAN.
#define TRACE_EVENT_API_ATOMIC_WORD intptr_t
-#define TRACE_EVENT_API_ATOMIC_LOAD(var) (*(&var))
-#define TRACE_EVENT_API_ATOMIC_STORE(var, value) (var=value)
+#define TRACE_EVENT_API_ATOMIC_LOAD(var) SK_ANNOTATE_UNPROTECTED_READ(var)
+#define TRACE_EVENT_API_ATOMIC_STORE(var, value) SK_ANNOTATE_UNPROTECTED_WRITE(&var, value)
// Defines visibility for classes in trace_event.h
#define TRACE_EVENT_API_CLASS_EXPORT SK_API
« no previous file with comments | « include/core/SkDynamicAnnotations.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698