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

Unified Diff: Source/platform/heap/Visitor.cpp

Issue 794223003: Cheaper thread-safe atomic initialization of static references. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add type check for initial value Created 5 years, 11 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
Index: Source/platform/heap/Visitor.cpp
diff --git a/Source/platform/heap/Visitor.cpp b/Source/platform/heap/Visitor.cpp
index 4256c1c3366c22442f4f0181b0df8b86914bcd6c..d5bc469abf586172842bb25d4df8397856021689 100644
--- a/Source/platform/heap/Visitor.cpp
+++ b/Source/platform/heap/Visitor.cpp
@@ -48,7 +48,7 @@ void GCInfoTable::ensureGCInfoIndex(const GCInfo* gcInfo, size_t* gcInfoIndexSlo
ASSERT(gcInfo);
ASSERT(gcInfoIndexSlot);
// Keep a global GCInfoTable lock while allocating a new slot.
- AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex);
+ AtomicallyInitializedStaticReference(Mutex, mutex, new Mutex);
MutexLocker locker(mutex);
// If more than one thread ends up allocating a slot for

Powered by Google App Engine
This is Rietveld 408576698