code.onehippo.org is currently readonly. We are migrating to code.bloomreach.com, please continue working there on Monday 14/12. See: https://docs.bloomreach.com/display/engineering/GitLab

Commit 7027fce3 authored by Ard Schrijvers's avatar Ard Schrijvers

REPO-1811 use getHoldCount() instead of protected access

parent 4a939b29
......@@ -124,18 +124,18 @@ public abstract class AbstractLockManager implements InternalLockManager {
lockThread.getName()));
}
lock.decrement();
if (lock.holdCount < 0) {
if (lock.getHoldCount() < 0) {
getLogger().error("Hold count of lock should never be able to be less than 0. Core implementation issue in {}. Remove " +
"lock for {} nonetheless.",
this.getClass().getName(), key);
localLocks.remove(key);
releasePersistedLock(key, lockThread.getName());
} else if (lock.holdCount == 0) {
} else if (lock.getHoldCount() == 0) {
getLogger().debug("Remove lock '{}'", key);
localLocks.remove(key);
releasePersistedLock(key, lockThread.getName());
} else {
getLogger().debug("Lock '{}' will not be removed since hold count is '{}'", key, lock.holdCount);
getLogger().debug("Lock '{}' will not be removed since hold count is '{}'", key, lock.getHoldCount());
}
}
......@@ -164,6 +164,7 @@ public abstract class AbstractLockManager implements InternalLockManager {
throw new LockException(msg);
}
}
abortPersistedLock(key);
}
......
......@@ -23,7 +23,7 @@ public class MutableLock extends Lock {
private WeakReference<Thread> thread;
int holdCount;
private int holdCount;
public MutableLock(final String lockKey, final String lockOwner, final String lockThread,
final long creationTime, final String status) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment