Index: base/memory/singleton.cc |
=================================================================== |
--- base/memory/singleton.cc (revision 255285) |
+++ base/memory/singleton.cc (working copy) |
@@ -18,7 +18,10 @@ |
// the object has been created. |
subtle::AtomicWord value; |
while (true) { |
- value = subtle::NoBarrier_Load(instance); |
+ // The load has acquire memory ordering as the thread which reads the |
+ // instance pointer must acquire visibility over the associated data. |
+ // The pairing Release_Store operation is in Singleton::get(). |
+ value = subtle::Acquire_Load(instance); |
if (value != kBeingCreatedMarker) |
break; |
PlatformThread::YieldCurrentThread(); |