diff options
author | 2014-06-30 14:14:01 -0700 | |
---|---|---|
committer | 2014-06-30 14:14:01 -0700 | |
commit | df022f5972ae6a2a1d96d15c50eca52cade3abd8 (patch) | |
tree | 044d9f4bce2513318859383a81887b9d0d182ca3 /src/ports/SkFontConfigInterface_android.cpp | |
parent | 935a9f6609d88b92044c2f6251bb8ff83cc8e588 (diff) |
Fix race condition in parallel font initialization.
Uses a mutex to guard construction of the singleton, which initialies
the non-threadsafe libfontconfig. Without this change, the parallel
path ops test runner crashes 6/10 and hangs 2/10 on startup; with this
change, 0/10 problems.
BUG=skia:2693
R=mtklein@google.com, bungeman@google.com, reed@google.com, tomhudson@google.com
Author: tomhudson@chromium.org
Review URL: https://codereview.chromium.org/355573006
Diffstat (limited to 'src/ports/SkFontConfigInterface_android.cpp')
-rw-r--r-- | src/ports/SkFontConfigInterface_android.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ports/SkFontConfigInterface_android.cpp b/src/ports/SkFontConfigInterface_android.cpp index 20e6c5eb84..1f901b9fa9 100644 --- a/src/ports/SkFontConfigInterface_android.cpp +++ b/src/ports/SkFontConfigInterface_android.cpp @@ -155,7 +155,8 @@ static SkFontConfigInterfaceAndroid* getSingletonInterface() { return gFontConfigInterface; } -SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface() { +SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface(SkBaseMutex*) { + // Doesn't need passed-in mutex because getSingletonInterface() uses one return getSingletonInterface(); } |