diff options
author | mtklein <mtklein@chromium.org> | 2016-05-04 11:31:29 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-04 11:31:29 -0700 |
commit | 427c2819d9237d7d7729c59238036cfc73c072ea (patch) | |
tree | 90d1d7ebba7d16bfbe56a6f59c6cf135c7161acf /src/lazy | |
parent | 325474dd42db6d5a16cc4cf18f06dad4e0d60e9f (diff) |
Modernize SkMutex and SkSemaphore.
- use <atomic>
- 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
Review-Url: https://codereview.chromium.org/1947153002
Diffstat (limited to 'src/lazy')
-rw-r--r-- | src/lazy/SkDiscardableMemoryPool.cpp | 13 | ||||
-rw-r--r-- | src/lazy/SkDiscardableMemoryPool.h | 3 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/lazy/SkDiscardableMemoryPool.cpp b/src/lazy/SkDiscardableMemoryPool.cpp index 1f3bcf93e9..2be4c755f1 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, SkBaseMutex* mutex = nullptr); + DiscardableMemoryPool(size_t budget, SkMutex* mutex = nullptr); virtual ~DiscardableMemoryPool(); SkDiscardableMemory* create(size_t bytes) override; @@ -52,9 +52,9 @@ public: #endif // SK_LAZY_CACHE_STATS private: - SkBaseMutex* fMutex; - size_t fBudget; - size_t fUsed; + SkMutex* fMutex; + size_t fBudget; + size_t fUsed; SkTInternalLList<PoolDiscardableMemory> fList; /** Function called to free memory if needed */ @@ -128,8 +128,7 @@ void PoolDiscardableMemory::unlock() { //////////////////////////////////////////////////////////////////////////////// -DiscardableMemoryPool::DiscardableMemoryPool(size_t budget, - SkBaseMutex* mutex) +DiscardableMemoryPool::DiscardableMemoryPool(size_t budget, SkMutex* mutex) : fMutex(mutex) , fBudget(budget) , fUsed(0) { @@ -241,7 +240,7 @@ void DiscardableMemoryPool::dumpPool() { } // namespace -SkDiscardableMemoryPool* SkDiscardableMemoryPool::Create(size_t size, SkBaseMutex* mutex) { +SkDiscardableMemoryPool* SkDiscardableMemoryPool::Create(size_t size, SkMutex* mutex) { return new DiscardableMemoryPool(size, mutex); } diff --git a/src/lazy/SkDiscardableMemoryPool.h b/src/lazy/SkDiscardableMemoryPool.h index 92ba48bcb4..ad8d796f66 100644 --- a/src/lazy/SkDiscardableMemoryPool.h +++ b/src/lazy/SkDiscardableMemoryPool.h @@ -52,8 +52,7 @@ public: * the pool works. * Without mutex, will be not be thread safe. */ - static SkDiscardableMemoryPool* Create( - size_t size, SkBaseMutex* mutex = nullptr); + static SkDiscardableMemoryPool* Create(size_t size, SkMutex* mutex = nullptr); }; /** |