diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2008-05-05 00:12:49 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2008-05-05 00:12:49 +0000 |
commit | da7d1e9c8f3b09b569ce208f8e5bddfe2d20dba3 (patch) | |
tree | 96a3c38c5f94199b679aa295ad0f9934b0c5774c /src/main/java/com/amazon/carbonado/repo/map | |
parent | a2d5fd1a0b36a7eab3ecdc0c3e5709fb57e5710b (diff) |
Made TestLockStates a proper unit test.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo/map')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java b/src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java index 9862791..e4e8a56 100644 --- a/src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java +++ b/src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java @@ -1122,6 +1122,13 @@ class UpgradableLock<L> { }
/**
+ * Used by unit tests.
+ */
+ boolean noLocksHeld() {
+ return mState == 0 && mOwner == null && mUpgradeCount == 0 && mWriteCount == 0;
+ }
+
+ /**
* Node class ripped off from AbstractQueuedSynchronizer and modified
* slightly. Read the comments in that class for better understanding.
*/
|