aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2017-07-27 18:09:24 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-27 22:49:16 +0000
commitce3f44a866a440a4da75562a038d35fd6584a483 (patch)
treeb0b0c03a04d098be164b6b5b28e9e237d59e823f /gn
parent16d8ec66cdce2f30ce89b87066d3ac7a244c460d (diff)
Don't re-enter mutex in SkFontMgr_fontconfig.
The FCLocker lock cannot be held while calling fTFCache::add. The ~SkTypeface_fontconfig method must take the FCLocker lock to destroy its FcPattern since a typeface may be destroyed by any last owner. However, fTFCache may be the last owner of some of its cached typefaces, and so a purge when calling ::add to make space for the new entry may cause a typeface to be destroyed. As a result, createTypefaceFromFcPattern must not hold the FCLocker lock when calling fTFCache::add. Fortunately, the FCLocker lock is only needed to serialize calls into FontConfig. If acquire and release were free then they would be used around each individual call to FontConfig. As a result it is fine to give up the lock at any point in Skia code so long as no FontConfig calls are made while the FCLocker lock is not held. Change-Id: I37224d4b38bf88ace482496ce7530c84158d2d2e Reviewed-on: https://skia-review.googlesource.com/27663 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'gn')
0 files changed, 0 insertions, 0 deletions