aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/lazy/SkDiscardableMemoryPool.cpp
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2014-06-11 09:40:23 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-11 09:40:23 -0700
commit9b7906672eb6794497d560761aa8bab824a13a90 (patch)
tree422a48ae6a9402fb6ebfca6296495d2603bbd057 /src/lazy/SkDiscardableMemoryPool.cpp
parent1c99ea8ed80ca492397717b57e2735869be38c69 (diff)
Use new SkBaseMutex::assertHeld() in DiscardableMemoryPool
R=mtklein@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/324413003
Diffstat (limited to 'src/lazy/SkDiscardableMemoryPool.cpp')
-rw-r--r--src/lazy/SkDiscardableMemoryPool.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lazy/SkDiscardableMemoryPool.cpp b/src/lazy/SkDiscardableMemoryPool.cpp
index 1d63a0bad7..db2754e473 100644
--- a/src/lazy/SkDiscardableMemoryPool.cpp
+++ b/src/lazy/SkDiscardableMemoryPool.cpp
@@ -145,9 +145,9 @@ DiscardableMemoryPool::~DiscardableMemoryPool() {
}
void DiscardableMemoryPool::dumpDownTo(size_t budget) {
- // assert((NULL = fMutex) || fMutex->isLocked());
- // TODO(halcanary) implement bool fMutex::isLocked().
- // WARNING: only call this function after aquiring lock.
+ if (fMutex != NULL) {
+ fMutex->assertHeld();
+ }
if (fUsed <= budget) {
return;
}