diff options
author | glider <glider@chromium.org> | 2014-09-23 14:50:16 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-23 21:50:27 +0000 |
commit | 3a065495f1e4edd6e8d9b510340a927a917a91e6 (patch) | |
tree | fd7d597a058481375ef904a393728563558bfd21 /base | |
parent | f37219757faac607fb53aa4afc925ac1324c0cb2 (diff) | |
download | chromium_src-3a065495f1e4edd6e8d9b510340a927a917a91e6.zip chromium_src-3a065495f1e4edd6e8d9b510340a927a917a91e6.tar.gz chromium_src-3a065495f1e4edd6e8d9b510340a927a917a91e6.tar.bz2 |
Remove TSan annotations from base/
, because ThreadSanitizer v2 doesn't need base::subtle to be annotated.
We can't drop the dependency on libdynamic_annotations yet, because some code calls RunningOnValgrind().
Also remove the unused dynamic_annotations.h headers from base/ and add one to content/test/, which uses RunningOnValgrind().
BUG=349861
R=ajwong@chromium.org,phajdan.jr@chromium.org
Review URL: https://codereview.chromium.org/580813002
Cr-Commit-Position: refs/heads/master@{#296265}
Diffstat (limited to 'base')
-rw-r--r-- | base/atomic_ref_count.h | 11 | ||||
-rw-r--r-- | base/lazy_instance.cc | 4 | ||||
-rw-r--r-- | base/lazy_instance.h | 8 | ||||
-rw-r--r-- | base/vlog_unittest.cc | 1 |
4 files changed, 0 insertions, 24 deletions
diff --git a/base/atomic_ref_count.h b/base/atomic_ref_count.h index 5130860..553fab6 100644 --- a/base/atomic_ref_count.h +++ b/base/atomic_ref_count.h @@ -12,7 +12,6 @@ #define BASE_ATOMIC_REF_COUNT_H_ #include "base/atomicops.h" -#include "base/third_party/dynamic_annotations/dynamic_annotations.h" namespace base { @@ -30,11 +29,7 @@ inline void AtomicRefCountIncN(volatile AtomicRefCount *ptr, // became zero will be visible to a thread that has just made the count zero. inline bool AtomicRefCountDecN(volatile AtomicRefCount *ptr, AtomicRefCount decrement) { - ANNOTATE_HAPPENS_BEFORE(ptr); bool res = (subtle::Barrier_AtomicIncrement(ptr, -decrement) != 0); - if (!res) { - ANNOTATE_HAPPENS_AFTER(ptr); - } return res; } @@ -58,9 +53,6 @@ inline bool AtomicRefCountDec(volatile AtomicRefCount *ptr) { // exclusive access to the object. inline bool AtomicRefCountIsOne(volatile AtomicRefCount *ptr) { bool res = (subtle::Acquire_Load(ptr) == 1); - if (res) { - ANNOTATE_HAPPENS_AFTER(ptr); - } return res; } @@ -69,9 +61,6 @@ inline bool AtomicRefCountIsOne(volatile AtomicRefCount *ptr) { // should never be zero. Hence this is generally used for a debug check. inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) { bool res = (subtle::Acquire_Load(ptr) == 0); - if (res) { - ANNOTATE_HAPPENS_AFTER(ptr); - } return res; } diff --git a/base/lazy_instance.cc b/base/lazy_instance.cc index a81cb8c..594c1fe 100644 --- a/base/lazy_instance.cc +++ b/base/lazy_instance.cc @@ -8,7 +8,6 @@ #include "base/atomicops.h" #include "base/basictypes.h" #include "base/threading/platform_thread.h" -#include "base/third_party/dynamic_annotations/dynamic_annotations.h" namespace base { namespace internal { @@ -42,9 +41,6 @@ void CompleteLazyInstance(subtle::AtomicWord* state, subtle::AtomicWord new_instance, void* lazy_instance, void (*dtor)(void*)) { - // See the comment to the corresponding HAPPENS_AFTER in Pointer(). - ANNOTATE_HAPPENS_BEFORE(state); - // Instance is created, go from CREATING to CREATED. // Releases visibility over private_buf_ to readers. Pairing Acquire_Load's // are in NeedsInstance() and Pointer(). diff --git a/base/lazy_instance.h b/base/lazy_instance.h index 05a7c5d..d52b543 100644 --- a/base/lazy_instance.h +++ b/base/lazy_instance.h @@ -43,7 +43,6 @@ #include "base/debug/leak_annotations.h" #include "base/logging.h" #include "base/memory/aligned_memory.h" -#include "base/third_party/dynamic_annotations/dynamic_annotations.h" #include "base/threading/thread_restrictions.h" // LazyInstance uses its own struct initializer-list style static @@ -166,13 +165,6 @@ class LazyInstance { internal::CompleteLazyInstance(&private_instance_, value, this, Traits::kRegisterOnExit ? OnExit : NULL); } - - // This annotation helps race detectors recognize correct lock-less - // synchronization between different threads calling Pointer(). - // We suggest dynamic race detection tool that "Traits::New" above - // and CompleteLazyInstance(...) happens before "return instance()" below. - // See the corresponding HAPPENS_BEFORE in CompleteLazyInstance(...). - ANNOTATE_HAPPENS_AFTER(&private_instance_); return instance(); } diff --git a/base/vlog_unittest.cc b/base/vlog_unittest.cc index 3a37cd9..b505d4c 100644 --- a/base/vlog_unittest.cc +++ b/base/vlog_unittest.cc @@ -6,7 +6,6 @@ #include "base/basictypes.h" #include "base/logging.h" -#include "base/third_party/dynamic_annotations/dynamic_annotations.h" #include "base/time/time.h" #include "testing/gtest/include/gtest/gtest.h" |