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

Unified Diff: src/core/SkGlyphCache_Globals.h

Issue 1210143004: SkGlyphCache_Globals: SkMutex -> SkSpinlock (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: some cleanup Created 5 years, 5 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
« include/core/SkMutex.h ('K') | « src/core/SkGlyphCache.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkGlyphCache_Globals.h
diff --git a/src/core/SkGlyphCache_Globals.h b/src/core/SkGlyphCache_Globals.h
index 4bd607c598037e39b4e992e75473d4ffdd74750c..373465d551198612b8ef5bdf9836918ef30afaed 100644
--- a/src/core/SkGlyphCache_Globals.h
+++ b/src/core/SkGlyphCache_Globals.h
@@ -9,6 +9,7 @@
#define SkGlyphCache_Globals_DEFINED
#include "SkGlyphCache.h"
+#include "SkSpinlock.h"
#include "SkTLS.h"
#ifndef SK_DEFAULT_FONT_CACHE_COUNT_LIMIT
@@ -22,9 +23,11 @@
///////////////////////////////////////////////////////////////////////////////
class SkMutex;
+class SkSpinlock;
class SkGlyphCache_Globals {
public:
+ using Lock = SkSpinlock;
enum UseMutex {
kNo_UseMutex, // thread-local cache
kYes_UseMutex // shared cache
@@ -37,7 +40,7 @@ public:
fCacheCount = 0;
fCacheCountLimit = SK_DEFAULT_FONT_CACHE_COUNT_LIMIT;
- fMutex = (kYes_UseMutex == um) ? SkNEW(SkMutex) : NULL;
+ fMutex = (kYes_UseMutex == um) ? SkNEW(SkSpinlock) : NULL;
mtklein 2015/07/08 19:33:47 Lock?
herb_g 2015/07/08 20:21:57 Ok. I have obviously botched the way TLS is being
}
~SkGlyphCache_Globals() {
@@ -51,7 +54,7 @@ public:
SkDELETE(fMutex);
}
- SkMutex* fMutex;
+ Lock* fMutex;
SkGlyphCache* internalGetHead() const { return fHead; }
SkGlyphCache* internalGetTail() const;
« include/core/SkMutex.h ('K') | « src/core/SkGlyphCache.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698