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

Unified Diff: Source/bindings/core/v8/ScriptProfiler.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/bindings/core/v8/ScriptProfiler.cpp
diff --git a/Source/bindings/core/v8/ScriptProfiler.cpp b/Source/bindings/core/v8/ScriptProfiler.cpp
index 7db431217e51ba7cc18291a631040d1bee581414..ec70515af708c5475b2d6b490acb45fbd71d4fc7 100644
--- a/Source/bindings/core/v8/ScriptProfiler.cpp
+++ b/Source/bindings/core/v8/ScriptProfiler.cpp
@@ -305,8 +305,8 @@ void ScriptProfiler::visitNodeWrappers(WrappedNodeVisitor* visitor)
ProfileNameIdleTimeMap* ScriptProfiler::currentProfileNameIdleTimeMap()
{
- AtomicallyInitializedStatic(WTF::ThreadSpecific<ProfileNameIdleTimeMap>*, map = new WTF::ThreadSpecific<ProfileNameIdleTimeMap>);
- return *map;
+ AtomicallyInitializedStaticReference(WTF::ThreadSpecific<ProfileNameIdleTimeMap>, map, new WTF::ThreadSpecific<ProfileNameIdleTimeMap>);
+ return map;
}
void ScriptProfiler::setIdle(bool isIdle)

Powered by Google App Engine
This is Rietveld 408576698