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

Unified Diff: Source/core/workers/WorkerThread.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/core/workers/WorkerThread.cpp
diff --git a/Source/core/workers/WorkerThread.cpp b/Source/core/workers/WorkerThread.cpp
index a08d7c5ec5afcd791cf69cdad1a0558aedfa4ffb..6a3f9e5bcccdfbce3424f4cc6c33cc3b74de16d4 100644
--- a/Source/core/workers/WorkerThread.cpp
+++ b/Source/core/workers/WorkerThread.cpp
@@ -71,7 +71,7 @@ public:
static Mutex& threadSetMutex()
{
- AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex);
+ AtomicallyInitializedStaticReference(Mutex, mutex, new Mutex);
return mutex;
}

Powered by Google App Engine
This is Rietveld 408576698