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

Unified Diff: Source/modules/webdatabase/Database.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/modules/webdatabase/Database.cpp
diff --git a/Source/modules/webdatabase/Database.cpp b/Source/modules/webdatabase/Database.cpp
index 316f79e7c087a3563f6b712cec2b87a31965ba3b..11904b2a2cc34bdc3a24a6a8da7848afc064094f 100644
--- a/Source/modules/webdatabase/Database.cpp
+++ b/Source/modules/webdatabase/Database.cpp
@@ -139,7 +139,7 @@ static bool setTextValueInDatabase(SQLiteDatabase& db, const String& query, cons
// FIXME: move all guid-related functions to a DatabaseVersionTracker class.
static RecursiveMutex& guidMutex()
{
- AtomicallyInitializedStatic(RecursiveMutex&, mutex = *new RecursiveMutex);
+ AtomicallyInitializedStaticReference(RecursiveMutex, mutex, new RecursiveMutex);
return mutex;
}

Powered by Google App Engine
This is Rietveld 408576698