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

Unified Diff: Source/modules/indexeddb/IDBDatabase.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/indexeddb/IDBDatabase.cpp
diff --git a/Source/modules/indexeddb/IDBDatabase.cpp b/Source/modules/indexeddb/IDBDatabase.cpp
index 3072927d15fd1579eb9a5f5b97fd17190482768e..c6fd7cb3d7b7be007f94d4030c58c63bee96ec60 100644
--- a/Source/modules/indexeddb/IDBDatabase.cpp
+++ b/Source/modules/indexeddb/IDBDatabase.cpp
@@ -107,7 +107,7 @@ int64_t IDBDatabase::nextTransactionId()
{
// Only keep a 32-bit counter to allow ports to use the other 32
// bits of the id.
- AtomicallyInitializedStatic(int, currentTransactionId = 0);
+ static int currentTransactionId = 0;
return atomicIncrement(&currentTransactionId);
}

Powered by Google App Engine
This is Rietveld 408576698