8151797: java/lang/management/ThreadMXBean/ThreadLists.java : inconsistent results
authorhb
Tue, 22 Mar 2016 01:13:06 -0700
changeset 37319 98886757c5aa
parent 37318 fee950a46e67
child 37320 a802ccc88c30
child 37322 696304418137
8151797: java/lang/management/ThreadMXBean/ThreadLists.java : inconsistent results Summary: Create ThreadMXBean at the beginning of test so that call-site cleaner thread will be started Reviewed-by: sla
jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java	Mon Mar 21 20:39:54 2016 -0700
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java	Tue Mar 22 01:13:06 2016 -0700
@@ -35,6 +35,11 @@
 public class ThreadLists {
     public static void main(String args[]) {
 
+        // Bug id : JDK-8151797
+        // Use a lambda expression so that call-site cleaner thread is started
+        Runnable printLambda = () -> {System.out.println("Starting Test");};
+        printLambda.run();
+
         // get top-level thread group
         ThreadGroup top = Thread.currentThread().getThreadGroup();
         ThreadGroup parent;