X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Fimpl%2FDeadlockMonitor.java;h=9882b4662cce2b75519b509135fd17c961e12e9d;hb=refs%2Fchanges%2F61%2F34561%2F2;hp=f25dce89e8f536e84e979b9aaee6887d28236a1d;hpb=597ffbbfe362fcea479b7fdb52f685289b7ea5fd;p=controller.git diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java index f25dce89e8..9882b4662c 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + package org.opendaylight.controller.config.manager.impl; import java.util.Deque; @@ -69,7 +77,11 @@ public class DeadlockMonitor implements AutoCloseable { 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; @@ -81,7 +93,7 @@ public class DeadlockMonitor implements AutoCloseable { } } try { - sleep(1000); + sleep(WARN_AFTER_MILLIS); } catch (InterruptedException e) { interrupt(); }