| 108 | } |
| 109 | |
| 110 | private static void dumpThread(ThreadInfo thread, Logger log) |
| 111 | { |
| 112 | log.log( Level.SEVERE, "------------------------------" ); |
| 113 | // |
| 114 | log.log( Level.SEVERE, "Current Thread: " + thread.getThreadName() ); |
| 115 | log.log( Level.SEVERE, "\tPID: " + thread.getThreadId() |
| 116 | + " | Suspended: " + thread.isSuspended() |
| 117 | + " | Native: " + thread.isInNative() |
| 118 | + " | State: " + thread.getThreadState() ); |
| 119 | if ( thread.getLockedMonitors().length != 0 ) |
| 120 | { |
| 121 | log.log( Level.SEVERE, "\tThread is waiting on monitor(s):" ); |
| 122 | for ( MonitorInfo monitor : thread.getLockedMonitors() ) |
| 123 | { |
| 124 | log.log( Level.SEVERE, "\t\tLocked on:" + monitor.getLockedStackFrame() ); |
| 125 | } |
| 126 | } |
| 127 | log.log( Level.SEVERE, "\tStack:" ); |
| 128 | // |
| 129 | for ( StackTraceElement stack : thread.getStackTrace() ) |
| 130 | { |
| 131 | log.log( Level.SEVERE, "\t\t" + stack ); |
| 132 | } |
| 133 | } |
| 134 | } |