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

Unified Diff: Source/wtf/HashTable.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/wtf/HashTable.cpp
diff --git a/Source/wtf/HashTable.cpp b/Source/wtf/HashTable.cpp
index 518a4c8c24ae5cda1fb0c6769ef604bf193dd7c1..cf9d48d12ae06e00d2f02282c1a00bff9e1a8ad3 100644
--- a/Source/wtf/HashTable.cpp
+++ b/Source/wtf/HashTable.cpp
@@ -35,7 +35,7 @@ int HashTableStats::numReinserts;
static Mutex& hashTableStatsMutex()
{
- AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex);
+ AtomicallyInitializedStaticReference(Mutex, mutex, new Mutex);
return mutex;
}

Powered by Google App Engine
This is Rietveld 408576698