diff options
Diffstat (limited to 'policy-core/src/main')
-rw-r--r-- | policy-core/src/main/java/org/onap/policy/drools/core/lock/LockImpl.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/lock/LockImpl.java b/policy-core/src/main/java/org/onap/policy/drools/core/lock/LockImpl.java index 9596dbe8..8866eb82 100644 --- a/policy-core/src/main/java/org/onap/policy/drools/core/lock/LockImpl.java +++ b/policy-core/src/main/java/org/onap/policy/drools/core/lock/LockImpl.java @@ -100,13 +100,15 @@ public class LockImpl implements Lock, Serializable { * This method always succeeds, unless the lock is already unavailable. */ @Override - public synchronized boolean free() { - if (isUnavailable()) { - return false; - } + public boolean free() { + synchronized (this) { + if (isUnavailable()) { + return false; + } - logger.info("releasing lock: {}", this); - setState(LockState.UNAVAILABLE); + logger.info("releasing lock: {}", this); + setState(LockState.UNAVAILABLE); + } return true; } |