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

Unified Diff: src/pdf/SkPDFShader.cpp

Issue 348113002: Use SkMutex::assertHeld in SkPDFFont and SkPDFShader. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: AnotherPatchSet 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
« no previous file with comments | « src/pdf/SkPDFFont.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFShader.cpp
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp
index 62adf5811db5a3672f73f5e1a8796b6c2596b779..23bd203f9d064cb6ecb069cfff220e15d42b5768 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -659,22 +659,20 @@ SkPDFObject* SkPDFShader::GetPDFShader(const SkShader& shader,
// static
SkTDArray<SkPDFShader::ShaderCanonicalEntry>& SkPDFShader::CanonicalShaders() {
- // This initialization is only thread safe with gcc.
+ SkPDFShader::CanonicalShadersMutex().assertHeld();
static SkTDArray<ShaderCanonicalEntry> gCanonicalShaders;
return gCanonicalShaders;
}
// static
SkBaseMutex& SkPDFShader::CanonicalShadersMutex() {
- // This initialization is only thread safe with gcc or when
- // POD-style mutex initialization is used.
SK_DECLARE_STATIC_MUTEX(gCanonicalShadersMutex);
return gCanonicalShadersMutex;
}
// static
SkPDFObject* SkPDFFunctionShader::RangeObject() {
- // This initialization is only thread safe with gcc.
+ SkPDFShader::CanonicalShadersMutex().assertHeld();
static SkPDFArray* range = NULL;
// This method is only used with CanonicalShadersMutex, so it's safe to
// populate domain.
« no previous file with comments | « src/pdf/SkPDFFont.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698