summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2008-12-13 04:30:49 +0000
committerBrian S. O'Neill <bronee@gmail.com>2008-12-13 04:30:49 +0000
commit8ad38ab09133b099f6a0b01e6e3df28e07b90de9 (patch)
treecf42f9af1f2a80e0f01d50306ed8c35c223c4c19
parenta8e3ebeece7c811b156b47aa789527bf5bb55b56 (diff)
Release upgrade lock if write lock not acquired.
-rw-r--r--src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java1
1 files changed, 1 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 60c9bfa..1992515 100644
--- a/src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java
+++ b/src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java
@@ -475,6 +475,7 @@ class UpgradableLock<L> {
return false;
}
if (!tryLockForWrite(locker)) {
+ unlockFromUpgrade(locker);
if ((timeout = unit.toNanos(timeout) - (System.nanoTime() - start)) <= 0) {
return false;
}