Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(983)

Unified Diff: src/core/SkSharedMutex.h

Issue 1285973003: Add asserts for shared mutex. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix line size. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkSharedMutex.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkSharedMutex.h
diff --git a/src/core/SkSharedMutex.h b/src/core/SkSharedMutex.h
index a3535dca430aad26b26ab33dc5ef4018609e96df..527bae2b6857f6ed392be27feca48af18fb0be0d 100644
--- a/src/core/SkSharedMutex.h
+++ b/src/core/SkSharedMutex.h
@@ -28,12 +28,18 @@ public:
// Release lock for exclusive use.
void release();
+ // Fail if exclusive is not held.
+ void assertHeld() const;
mtklein 2015/08/19 19:00:51 Let's do something like this to make sure these ar
herb_g 2015/08/19 20:30:50 Done.
+
// Acquire lock for shared use.
void acquireShared();
// Release lock for shared use.
void releaseShared();
+ // Fail if shared lock not held.
+ void assertHeldShared() const;
+
private:
SkAtomic<int32_t> fQueueCounts;
SkSemaphore fSharedQueue;
« no previous file with comments | « no previous file | src/core/SkSharedMutex.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698