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

Unified Diff: include/core/SkDynamicAnnotations.h

Issue 996763002: Clean up SkDynamicAnnotations. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: review Created 5 years, 9 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 | « gyp/common_conditions.gypi ('k') | include/core/SkLazyPtr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkDynamicAnnotations.h
diff --git a/include/core/SkDynamicAnnotations.h b/include/core/SkDynamicAnnotations.h
deleted file mode 100644
index 86b01814a8f38ba005c0ac6105150c492573a87a..0000000000000000000000000000000000000000
--- a/include/core/SkDynamicAnnotations.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkDynamicAnnotations_DEFINED
-#define SkDynamicAnnotations_DEFINED
-
-// Make sure we see anything set via SkUserConfig.h (e.g. DYNAMIC_ANNOTATIONS_ENABLED).
-#include "SkTypes.h"
-
-// This file contains macros used to send out-of-band signals to dynamic instrumentation systems,
-// namely thread sanitizer. This is a cut-down version of the full dynamic_annotations library with
-// only the features used by Skia.
-
-#if DYNAMIC_ANNOTATIONS_ENABLED
-
-extern "C" {
-// TSAN provides these hooks.
-void AnnotateIgnoreReadsBegin(const char* file, int line);
-void AnnotateIgnoreReadsEnd(const char* file, int line);
-void AnnotateIgnoreWritesBegin(const char* file, int line);
-void AnnotateIgnoreWritesEnd(const char* file, int line);
-} // extern "C"
-
-// SK_ANNOTATE_UNPROTECTED_READ can wrap any variable read to tell TSAN to ignore that it appears to
-// be a racy read. This should be used only when we can make an external guarantee that though this
-// particular read is racy, it is being used as part of a mechanism which is thread safe. Examples:
-// - the first check in double-checked locking;
-// - checking if a ref count is equal to 1.
-// Note that in both these cases, we must still add terrifyingly subtle memory barriers to provide
-// that overall thread safety guarantee. Using this macro to shut TSAN up without providing such an
-// external guarantee is pretty much never correct.
-template <typename T>
-inline T SK_ANNOTATE_UNPROTECTED_READ(const volatile T& x) {
- AnnotateIgnoreReadsBegin(__FILE__, __LINE__);
- T read = x;
- AnnotateIgnoreReadsEnd(__FILE__, __LINE__);
- return read;
-}
-
-// Like SK_ANNOTATE_UNPROTECTED_READ, but for writes.
-template <typename T>
-inline void SK_ANNOTATE_UNPROTECTED_WRITE(T* ptr, const T& val) {
- AnnotateIgnoreWritesBegin(__FILE__, __LINE__);
- *ptr = val;
- AnnotateIgnoreWritesEnd(__FILE__, __LINE__);
-}
-
-#else // !DYNAMIC_ANNOTATIONS_ENABLED
-
-#define SK_ANNOTATE_UNPROTECTED_READ(x) (x)
-#define SK_ANNOTATE_UNPROTECTED_WRITE(ptr, val) *(ptr) = (val)
-
-#endif
-
-#endif//SkDynamicAnnotations_DEFINED
« no previous file with comments | « gyp/common_conditions.gypi ('k') | include/core/SkLazyPtr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698