summaryrefslogtreecommitdiffstats
path: root/policy-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'policy-core/src')
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/lock/LockImpl.java14
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;
}