Index: src/core/SkSharedMutex.h |
diff --git a/src/core/SkSharedMutex.h b/src/core/SkSharedMutex.h |
index ea948d3f6c90bdf03cce8be77c609b32f541f5c5..840c2d36adf152b50087675eb1140c78001dd407 100644 |
--- a/src/core/SkSharedMutex.h |
+++ b/src/core/SkSharedMutex.h |
@@ -69,4 +69,14 @@ inline void SkSharedMutex::assertHeld() const {}; |
inline void SkSharedMutex::assertHeldShared() const {}; |
#endif // SK_DEBUG |
+class SkAutoSharedMutexShared { |
bungeman-skia
2015/10/21 21:19:09
After some thinking about it I do get the name, bu
|
+public: |
+ SkAutoSharedMutexShared(SkSharedMutex& lock) : fLock(lock) { lock.acquireShared(); } |
+ ~SkAutoSharedMutexShared() { fLock.releaseShared(); } |
+private: |
+ SkSharedMutex& fLock; |
+}; |
+ |
+#define SkAutoSharedMutexShared(...) SK_REQUIRE_LOCAL_VAR(SkAutoSharedMutexShared) |
+ |
#endif // SkSharedLock_DEFINED |