979 |
|
* Uninteresting threads are filtered out. |
980 |
|
*/ |
981 |
|
static void dumpTestThreads() { |
982 |
+ |
SecurityManager sm = System.getSecurityManager(); |
983 |
+ |
if (sm != null) { |
984 |
+ |
try { |
985 |
+ |
System.setSecurityManager(null); |
986 |
+ |
} catch (SecurityException giveUp) { |
987 |
+ |
return; |
988 |
+ |
} |
989 |
+ |
} |
990 |
+ |
|
991 |
|
ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); |
992 |
|
System.err.println("------ stacktrace dump start ------"); |
993 |
|
for (ThreadInfo info : threadMXBean.dumpAllThreads(true, true)) { |
1005 |
|
System.err.print(info); |
1006 |
|
} |
1007 |
|
System.err.println("------ stacktrace dump end ------"); |
1008 |
+ |
|
1009 |
+ |
if (sm != null) System.setSecurityManager(sm); |
1010 |
|
} |
1011 |
|
|
1012 |
|
/** |