Index: src/core/SkSharedMutex.h |
diff --git a/src/core/SkSharedMutex.h b/src/core/SkSharedMutex.h |
index a3535dca430aad26b26ab33dc5ef4018609e96df..f3430040e38b51ee05ddb9d2915db44a30ff6ec3 100644 |
--- a/src/core/SkSharedMutex.h |
+++ b/src/core/SkSharedMutex.h |
@@ -28,16 +28,31 @@ public: |
// Release lock for exclusive use. |
void release(); |
+ // Fail if exclusive is not held. |
+#ifdef SK_DEBUG |
+ void assertHeld() const; |
+#else |
+ void assertHeld() const {} |
+#endif |
+ |
// Acquire lock for shared use. |
void acquireShared(); |
// Release lock for shared use. |
void releaseShared(); |
+ // Fail if shared lock not held. |
+#ifdef SK_DEBUG |
+ void assertHeldShared() const; |
+#else |
+ void assertHeldShared() const {} |
+#endif |
+ |
private: |
SkAtomic<int32_t> fQueueCounts; |
SkSemaphore fSharedQueue; |
SkSemaphore fExclusiveQueue; |
}; |
+ |
#endif // SkSharedLock_DEFINED |