summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHristo Iliev2010-09-15 10:46:37 (EDT)
committer Glyn Normington2010-09-15 10:46:37 (EDT)
commit3426a47c609124e4571d9e9f579f6a02fc0a7e69 (patch)
tree2e581a1a34de7f880f03b15613362756dce1e9a9
parent349c7d0af39dde7a3d69be0e60e597be5d759c93 (diff)
downloadorg.eclipse.virgo.medic-3426a47c609124e4571d9e9f579f6a02fc0a7e69.zip
org.eclipse.virgo.medic-3426a47c609124e4571d9e9f579f6a02fc0a7e69.tar.gz
org.eclipse.virgo.medic-3426a47c609124e4571d9e9f579f6a02fc0a7e69.tar.bz2
bug 309688: obtain deadlocked thread info from the VM
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/thread/StandardThreadInfoWriter.java23
1 files changed, 1 insertions, 22 deletions
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/thread/StandardThreadInfoWriter.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/thread/StandardThreadInfoWriter.java
index fe01b2e..2adab11 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/thread/StandardThreadInfoWriter.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/thread/StandardThreadInfoWriter.java
@@ -18,28 +18,7 @@ import java.lang.management.ThreadInfo;
class StandardThreadInfoWriter implements ThreadInfoWriter {
public void write(ThreadInfo threadInfo, PrintWriter writer) {
- writer.print(String.format("\"%s\" Id=%s %s", threadInfo.getThreadName(), threadInfo.getThreadId(), threadInfo.getThreadState()));
- if (threadInfo.getLockName() != null) {
- writer.print(String.format(" on %s", threadInfo.getLockName()));
- if (threadInfo.getLockOwnerName() != null) {
- writer.print(String.format(" owned by \"%s\" Id=%s", threadInfo.getLockOwnerName(), threadInfo.getLockOwnerId()));
- }
- }
- if (threadInfo.isInNative()) {
- writer.println(" (in native)");
- } else {
- writer.println();
- }
- MonitorInfo[] lockedMonitors = threadInfo.getLockedMonitors();
-
- StackTraceElement[] stackTraceElements = threadInfo.getStackTrace();
- for (StackTraceElement stackTraceElement : stackTraceElements) {
- writer.println(" at " + stackTraceElement);
- MonitorInfo lockedMonitor = findLockedMonitor(stackTraceElement, lockedMonitors);
- if (lockedMonitor != null) {
- writer.println(" - locked " + lockedMonitor.getClassName() + "@" + lockedMonitor.getIdentityHashCode());
- }
- }
+ writer.print(threadInfo.toString().replaceAll("\n", System.getProperty("line.separator")));
}
private static MonitorInfo findLockedMonitor(StackTraceElement stackTraceElement, MonitorInfo[] lockedMonitors) {