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

Side by Side Diff: include/core/SkDynamicAnnotations.h

Issue 144953005: TSAN: use somewhat pithier SK_ANNOTATE_UNPROTECTED_READ. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | include/core/SkOnce.h » ('j') | include/core/SkRefCnt.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkDynamicAnnotations_DEFINED
9 #define SkDynamicAnnotations_DEFINED
10
11 // We nabbed this code from the dynamic_annotations library, and in their honor
12 // we check the same define. Add other macros you use here.
reed1 2014/02/04 14:57:55 I have no idea what this stuff does. Can we also n
13
14 #if DYNAMIC_ANNOTATIONS_ENABLED
15
16 extern "C" {
17 // TSAN provides these hooks.
18 void AnnotateIgnoreReadsBegin(const char* file, int line);
19 void AnnotateIgnoreReadsEnd(const char* file, int line);
20 } // extern "C"
21
22 template <typename T>
23 inline T SK_ANNOTATE_UNPROTECTED_READ(const volatile T& x) {
24 AnnotateIgnoreReadsBegin(__FILE__, __LINE__);
25 T read = x;
26 AnnotateIgnoreReadsEnd(__FILE__, __LINE__);
27 return read;
28 }
29
30 #else // !DYNAMIC_ANNOTATIONS_ENABLED
31
32 #define SK_ANNOTATE_UNPROTECTED_READ(x) (x)
33
34 #endif
35
36 #endif//SkDynamicAnnotations_DEFINED
OLDNEW
« no previous file with comments | « no previous file | include/core/SkOnce.h » ('j') | include/core/SkRefCnt.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698