From d9f5d20f81b15190fa858eda1f536deae21e8e78 Mon Sep 17 00:00:00 2001 From: sclittle Date: Wed, 4 May 2016 18:23:30 -0700 Subject: Revert of Modernize SkMutex and SkSemaphore. (patchset #2 id:20001 of https://codereview.chromium.org/1947153002/ ) Reason for revert: This CL seems to have broken the Linux x64 and Mac bots, e.g. https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052 https://build.chromium.org/p/chromium/builders/Mac/builds/15151 The error appears to have something to do with new static initializers being added. Original issue's description: > Modernize SkMutex and SkSemaphore. > > - use > - fuse SkMutex and SkBaseMutex > - fuse SkSemaphore and SkBaseSemaphore > > Still TODO: > - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name > > I just didn't want to bother fixing all that up until I know this CL sticks. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1947153002 > > No public API changes. > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/427c2819d9237d7d7729c59238036cfc73c072ea TBR=herb@google.com,mtklein@chromium.org,reed@google.com,bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=609340 Review-Url: https://codereview.chromium.org/1945343003 --- src/lazy/SkDiscardableMemoryPool.cpp | 13 +++++++------ src/lazy/SkDiscardableMemoryPool.h | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src/lazy') diff --git a/src/lazy/SkDiscardableMemoryPool.cpp b/src/lazy/SkDiscardableMemoryPool.cpp index 2be4c755f1..1f3bcf93e9 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 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,7 +241,7 @@ 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); } diff --git a/src/lazy/SkDiscardableMemoryPool.h b/src/lazy/SkDiscardableMemoryPool.h index ad8d796f66..92ba48bcb4 100644 --- a/src/lazy/SkDiscardableMemoryPool.h +++ b/src/lazy/SkDiscardableMemoryPool.h @@ -52,7 +52,8 @@ public: * the pool works. * Without mutex, will be not be thread safe. */ - static SkDiscardableMemoryPool* Create(size_t size, SkMutex* mutex = nullptr); + static SkDiscardableMemoryPool* Create( + size_t size, SkBaseMutex* mutex = nullptr); }; /** -- cgit v1.2.3