Bug fix, Lock
[nonrtric.git] / policy-agent / src / main / java / org / oransc / policyagent / repository / Lock.java
index def2b30..a19870b 100644 (file)
@@ -130,7 +130,8 @@ public class Lock {
 
     @Override
     public String toString() {
-        return "Lock cnt: " + this.lockCounter + " exclusive: " + this.isExclusive;
+        return "Lock cnt: " + this.lockCounter + " exclusive: " + this.isExclusive + " queued: "
+            + this.lockRequestQueue.size();
     }
 
     /** returns the current number of granted locks */
@@ -166,6 +167,7 @@ public class Lock {
 
     private synchronized void addToQueue(MonoSink<Lock> callback, LockType lockType) {
         lockRequestQueue.add(new LockRequest(callback, lockType, this));
+        processQueuedEntries();
     }
 
     @SuppressWarnings("java:S2274") // Always invoke wait() and await() methods inside a loop