changeset 14132:645a9be6eddb

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
author hb
date Tue, 22 Mar 2016 01:13:06 -0700
parents 4ef83a6b90e8
children 5a553039e9fc 277d7584fa03
files test/java/lang/management/ThreadMXBean/ThreadLists.java
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/lang/management/ThreadMXBean/ThreadLists.java	Mon Mar 21 20:39:54 2016 -0700
+++ b/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;