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;
}
}
try {
- sleep(1000);
+ sleep(WARN_AFTER_MILLIS);
} catch (InterruptedException e) {
interrupt();
}