提交 0dae2e33 authored 作者: Jacek Ławrynowicz's avatar Jacek Ławrynowicz

ThreadDeadlockDetector - remove redundant timer field

上级 49c646b1
...@@ -32,13 +32,13 @@ public class ThreadDeadlockDetector { ...@@ -32,13 +32,13 @@ public class ThreadDeadlockDetector {
private final ThreadMXBean threadBean; private final ThreadMXBean threadBean;
// a daemon thread
private final Timer threadCheck = new Timer("ThreadDeadlockDetector", true);
private ThreadDeadlockDetector() { private ThreadDeadlockDetector() {
this.threadBean = ManagementFactory.getThreadMXBean(); this.threadBean = ManagementFactory.getThreadMXBean();
// a daemon thread
// delay: 10 ms // delay: 10 ms
// period: 10000 ms (100 seconds) // period: 10000 ms (100 seconds)
Timer threadCheck = new Timer("ThreadDeadlockDetector", true);
threadCheck.schedule(new TimerTask() { threadCheck.schedule(new TimerTask() {
@Override @Override
public void run() { public void run() {
...@@ -194,4 +194,4 @@ public class ThreadDeadlockDetector { ...@@ -194,4 +194,4 @@ public class ThreadDeadlockDetector {
print.println(); print.println();
} }
} }
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论