Skip to content

Commit 4397f27

Browse files
committed
Prevent CME from thread dumper
1 parent ad60b1d commit 4397f27

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

common/src/main/java/org/embeddedt/modernfix/core/ModernFixMixinPlugin.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,16 @@ public ModernFixMixinPlugin() {
6565
ModernFixPlatformHooks.injectPlatformSpecificHacks();
6666

6767
if(ModernFixMixinPlugin.instance.isOptionEnabled("feature.spam_thread_dump.ThreadDumper")) {
68+
// run once to trigger classloading
69+
ThreadDumper.obtainThreadDump();
6870
Thread t = new Thread() {
6971
public void run() {
7072
while(true) {
71-
logger.error("------ DEBUG THREAD DUMP (occurs every 60 seconds) ------");
72-
logger.error(ThreadDumper.obtainThreadDump());
73-
try { Thread.sleep(60000); } catch(InterruptedException e) {}
73+
try {
74+
Thread.sleep(60000);
75+
logger.error("------ DEBUG THREAD DUMP (occurs every 60 seconds) ------");
76+
logger.error(ThreadDumper.obtainThreadDump());
77+
} catch(InterruptedException | RuntimeException e) {}
7478
}
7579
}
7680
};

0 commit comments

Comments
 (0)