Codebase list nsync / 6fa0bcb
New upstream version 1.24.0 Mo Zhou 3 years ago
3 changed file(s) with 25 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
5858 one with
5959 tools/mkmakefile.sh
6060
61 The main reason it might fail is if it cannot find a suitable implentation of
61 The main reason it might fail is if it cannot find a suitable implementation of
6262 atomic operations on the platform. Atomic operations may be provided by
6363 - compiler-dependent interfaces (currently, gcc and clang)
6464 These are auto detected by mkmakefile.sh.
0 1.20.1
0 1.24.0
2424 #include "nsync_note.h"
2525
2626 /* Annotations for race detectors. */
27 #if defined(__has_feature)
28 #if __has_feature(thread_sanitizer)
29 #include "third_party/absl/base/dynamic_annotations.h"
30 #define IGNORE_RACES_START() ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN()
31 #define IGNORE_RACES_END() ANNOTATE_IGNORE_READS_AND_WRITES_END()
32 #endif
33 #endif
34 #if !defined(IGNORE_RACES_START)
27 #if defined(__has_feature) && !defined(__SANITIZE_THREAD__)
28 #if __has_feature(thread_sanitizer) /* used by clang */
29 #define __SANITIZE_THREAD__ 1 /* GCC uses this; fake it in clang */
30 #endif
31 #endif
32 #if defined(__SANITIZE_THREAD__)
33 NSYNC_C_START_
34 void AnnotateIgnoreWritesBegin(const char* file, int line);
35 void AnnotateIgnoreWritesEnd(const char* file, int line);
36 void AnnotateIgnoreReadsBegin(const char* file, int line);
37 void AnnotateIgnoreReadsEnd(const char* file, int line);
38 NSYNC_C_END_
39 #define IGNORE_RACES_START() \
40 do { \
41 AnnotateIgnoreReadsBegin(__FILE__, __LINE__); \
42 AnnotateIgnoreWritesBegin(__FILE__, __LINE__); \
43 } while (0)
44 #define IGNORE_RACES_END() \
45 do { \
46 AnnotateIgnoreWritesEnd(__FILE__, __LINE__); \
47 AnnotateIgnoreReadsEnd(__FILE__, __LINE__); \
48 } while (0)
49 #else
3550 #define IGNORE_RACES_START()
3651 #define IGNORE_RACES_END()
3752 #endif