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

Unified Diff: src/ports/SkFontConfigInterface_direct.cpp

Issue 355573006: Fix race condition in parallel font initialization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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: src/ports/SkFontConfigInterface_direct.cpp
diff --git a/src/ports/SkFontConfigInterface_direct.cpp b/src/ports/SkFontConfigInterface_direct.cpp
index dc9afbae1f47b642704ca02df68923145f38898f..25c965daddacc4b56a89d4d995c3469c7479fd9a 100644
--- a/src/ports/SkFontConfigInterface_direct.cpp
+++ b/src/ports/SkFontConfigInterface_direct.cpp
@@ -124,7 +124,8 @@ private:
SkMutex mutex_;
};
-SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface() {
+SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface(SkBaseMutex& mutex) {
+ SkAutoMutexAcquire ac(mutex);
SK_DECLARE_STATIC_LAZY_PTR(SkFontConfigInterfaceDirect, direct);
mtklein 2014/06/26 18:59:07 Given the mutex lock, this can become simply stat
tomhudson 2014/06/26 21:01:52 SK_DECLARE_STATIC_LAZY_PTR does nicely describe wh
return direct.get();
}

Powered by Google App Engine
This is Rietveld 408576698