Check if any threads are deadlocked. If any, print the thread dump for those threads. @return a deadlock message and the formatted thread dump of the deadlocked threads
()
| 362 | * @return a deadlock message and the formatted thread dump of the deadlocked threads |
| 363 | */ |
| 364 | public static String findDeadlock() { |
| 365 | long[] ids = threadMXBean.findDeadlockedThreads(); |
| 366 | if (ids != null) { |
| 367 | ThreadInfo[] tinfos = threadMXBean.getThreadInfo(threadMXBean.findDeadlockedThreads(), true, true); |
| 368 | if (tinfos != null) { |
| 369 | return sm.getString("diagnostics.deadlockFound") + CRLF + getThreadDump(tinfos); |
| 370 | } |
| 371 | } |
| 372 | return ""; |
| 373 | } |
| 374 | |
| 375 | /** |
| 376 | * Retrieves a formatted JVM thread dump. The default StringManager will be used. |
no test coverage detected