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

Unified Diff: src/lazy/SkDiscardableMemoryPool.cpp

Issue 1948233002: Revert "Modernize SkMutex and SkSemaphore." (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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/lazy/SkDiscardableMemoryPool.h ('k') | src/pathops/SkPathOpsDebug.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lazy/SkDiscardableMemoryPool.cpp
diff --git a/src/lazy/SkDiscardableMemoryPool.cpp b/src/lazy/SkDiscardableMemoryPool.cpp
index da7db529583234ff4b2fbb13b23ef281a85a0e9b..6ced5bfc027da33340ab5dc7e4b022568ce8ca78 100644
--- a/src/lazy/SkDiscardableMemoryPool.cpp
+++ b/src/lazy/SkDiscardableMemoryPool.cpp
@@ -29,7 +29,7 @@ public:
/**
* Without mutex, will be not be thread safe.
*/
- DiscardableMemoryPool(size_t budget, SkMutex* mutex = nullptr);
+ DiscardableMemoryPool(size_t budget, SkBaseMutex* mutex = nullptr);
virtual ~DiscardableMemoryPool();
SkDiscardableMemory* create(size_t bytes) override;
@@ -52,9 +52,9 @@ public:
#endif // SK_LAZY_CACHE_STATS
private:
- SkMutex* fMutex;
- size_t fBudget;
- size_t fUsed;
+ SkBaseMutex* fMutex;
+ size_t fBudget;
+ size_t fUsed;
SkTInternalLList<PoolDiscardableMemory> fList;
/** Function called to free memory if needed */
@@ -128,7 +128,8 @@ void PoolDiscardableMemory::unlock() {
////////////////////////////////////////////////////////////////////////////////
-DiscardableMemoryPool::DiscardableMemoryPool(size_t budget, SkMutex* mutex)
+DiscardableMemoryPool::DiscardableMemoryPool(size_t budget,
+ SkBaseMutex* mutex)
: fMutex(mutex)
, fBudget(budget)
, fUsed(0) {
@@ -240,11 +241,11 @@ void DiscardableMemoryPool::dumpPool() {
} // namespace
-SkDiscardableMemoryPool* SkDiscardableMemoryPool::Create(size_t size, SkMutex* mutex) {
+SkDiscardableMemoryPool* SkDiscardableMemoryPool::Create(size_t size, SkBaseMutex* mutex) {
return new DiscardableMemoryPool(size, mutex);
}
-static SkMutex gMutex;
+SK_DECLARE_STATIC_MUTEX(gMutex);
SkDiscardableMemoryPool* SkGetGlobalDiscardableMemoryPool() {
static SkOnce once;
« no previous file with comments | « src/lazy/SkDiscardableMemoryPool.h ('k') | src/pathops/SkPathOpsDebug.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698