Index: include/core/SkThread.h |
diff --git a/include/core/SkThread.h b/include/core/SkThread.h |
index 3038e2d9542325503295f7603fd60b45b4fca80f..4f7f326097297d3e54af718073ccce9378f543d6 100644 |
--- a/include/core/SkThread.h |
+++ b/include/core/SkThread.h |
@@ -83,8 +83,9 @@ template <typename T> void sk_release_store(T*, T); |
class SkBaseMutex { |
public: |
- void acquire(); |
- void release(); |
+ void acquire(); // Block until this thread owns the mutex. |
+ void release(); // Assuming this thread owns the mutex, release it. |
+ void assertHeld(); // If SK_DEBUG, assert this thread owns the mutex. |
}; |
class SkMutex : SkBaseMutex { |
@@ -128,6 +129,12 @@ public: |
} |
} |
+ /** Assert that we're holding the mutex. */ |
+ void assertHeld() { |
+ SkASSERT(fMutex); |
+ fMutex->assertHeld(); |
+ } |
+ |
private: |
SkBaseMutex* fMutex; |
}; |