ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/JSR166TestCase.java
(Generate patch)

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.149 by jsr166, Sat Oct 3 16:57:25 2015 UTC vs.
Revision 1.150 by jsr166, Sat Oct 3 19:08:13 2015 UTC

# Line 15 | Line 15 | import java.io.ObjectInputStream;
15   import java.io.ObjectOutputStream;
16   import java.lang.management.ManagementFactory;
17   import java.lang.management.ThreadInfo;
18 + import java.lang.management.ThreadMXBean;
19   import java.lang.reflect.Constructor;
20   import java.lang.reflect.Method;
21   import java.lang.reflect.Modifier;
# Line 798 | Line 799 | public class JSR166TestCase extends Test
799  
800      /**
801       * A debugging tool to print all stack traces, as jstack does.
802 +     * Uninteresting threads are filtered out.
803       */
804      static void printAllStackTraces() {
805 <        for (ThreadInfo info :
806 <                 ManagementFactory.getThreadMXBean()
807 <                 .dumpAllThreads(true, true))
805 >        ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
806 >        System.err.println("------ stacktrace dump start ------");
807 >        for (ThreadInfo info : threadMXBean.dumpAllThreads(true, true)) {
808 >            String name = info.getThreadName();
809 >            if ("Signal Dispatcher".equals(name))
810 >                continue;
811 >            if ("Reference Handler".equals(name)
812 >                && info.getLockName().startsWith("java.lang.ref.Reference$Lock"))
813 >                continue;
814 >            if ("Finalizer".equals(name)
815 >                && info.getLockName().startsWith("java.lang.ref.ReferenceQueue$Lock"))
816 >                continue;
817              System.err.print(info);
818 +        }
819 +        System.err.println("------ stacktrace dump end ------");
820      }
821  
822      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines