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

Unified Diff: base/memory/singleton.h

Issue 790473002: Remove the happens-before annotations from base/memory/singleton.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation of content/browser/gamepad/gamepad_provider.cc Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/trace_event/trace_event_synthetic_delay.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/singleton.h
diff --git a/base/memory/singleton.h b/base/memory/singleton.h
index e5e2e3efed08527f0172d9b6b85866eaf8a37ea2..e50bdc05f34eeecefc293529e7eeab0e9da0bbde 100644
--- a/base/memory/singleton.h
+++ b/base/memory/singleton.h
@@ -23,7 +23,6 @@
#include "base/atomicops.h"
#include "base/base_export.h"
#include "base/memory/aligned_memory.h"
-#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
#include "base/threading/thread_restrictions.h"
namespace base {
@@ -237,8 +236,6 @@ class Singleton {
// instance_ pointer must acquire visibility over the singleton data.
base::subtle::AtomicWord value = base::subtle::Acquire_Load(&instance_);
if (value != 0 && value != base::internal::kBeingCreatedMarker) {
- // See the corresponding HAPPENS_BEFORE below.
- ANNOTATE_HAPPENS_AFTER(&instance_);
return reinterpret_cast<Type*>(value);
}
@@ -250,10 +247,6 @@ class Singleton {
// stop right after we do this store.
Type* newval = Traits::New();
- // This annotation helps race detectors recognize correct lock-less
- // synchronization between different threads calling get().
- // See the corresponding HAPPENS_AFTER below and above.
- ANNOTATE_HAPPENS_BEFORE(&instance_);
// Releases the visibility over instance_ to the readers.
base::subtle::Release_Store(
&instance_, reinterpret_cast<base::subtle::AtomicWord>(newval));
@@ -267,8 +260,6 @@ class Singleton {
// We hit a race. Wait for the other thread to complete it.
value = base::internal::WaitForInstance(&instance_);
- // See the corresponding HAPPENS_BEFORE above.
- ANNOTATE_HAPPENS_AFTER(&instance_);
return reinterpret_cast<Type*>(value);
}
« no previous file with comments | « no previous file | base/trace_event/trace_event_synthetic_delay.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698