Reduce output from DeadlockMonitor
[controller.git] / opendaylight / config / config-manager / src / main / java / org / opendaylight / controller / config / manager / impl / DeadlockMonitor.java
index e3fbcd0edb97d0b55b91e01b7804539ff04ea30d..9882b4662cce2b75519b509135fd17c961e12e9d 100644 (file)
@@ -77,7 +77,11 @@ public class DeadlockMonitor implements AutoCloseable {
         public void run() {
             ModuleIdentifierWithNanos old = new ModuleIdentifierWithNanos(); // null moduleId
             while (this.isInterrupted() == false) {
         public void run() {
             ModuleIdentifierWithNanos old = new ModuleIdentifierWithNanos(); // null moduleId
             while (this.isInterrupted() == false) {
-                ModuleIdentifierWithNanos copy = new ModuleIdentifierWithNanos(DeadlockMonitor.this.top);
+                ModuleIdentifierWithNanos copy;
+                synchronized(this) {
+                    copy = new ModuleIdentifierWithNanos(DeadlockMonitor.this.top);
+                }
+
                 if (old.moduleIdentifier == null || old.equals(copy) == false) {
                     // started
                     old = copy;
                 if (old.moduleIdentifier == null || old.equals(copy) == false) {
                     // started
                     old = copy;
@@ -89,7 +93,7 @@ public class DeadlockMonitor implements AutoCloseable {
                     }
                 }
                 try {
                     }
                 }
                 try {
-                    sleep(1000);
+                    sleep(WARN_AFTER_MILLIS);
                 } catch (InterruptedException e) {
                     interrupt();
                 }
                 } catch (InterruptedException e) {
                     interrupt();
                 }