--- /dev/null 2017-10-10 14:31:03.217645158 +0200 +++ new/test/hotspot/jtreg/runtime/handshake/TestTrans.java 2017-10-11 15:25:56.141212816 +0200 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + */ + +import java.io.File; +import java.nio.file.Paths; +import java.time.Duration; + +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; + +/* + * @test + * @requires vm.debug + * @library /test/lib + * @run main/native TestTrans + */ +public class TestTrans { + + public static native void someTime(int ms); + + public static void main(String[] args) throws Exception { + String lib = System.getProperty("test.nativepath"); + ProcessBuilder pb = + ProcessTools.createJavaProcessBuilder( + true, + "-Djava.library.path=" + lib, + "-XX:+SafepointALot", + "-XX:GuaranteedSafepointInterval=20", + "-Xlog:ergo*", + "-XX:ParallelGCThreads=1", + "-XX:ConcGCThreads=1", + "-XX:CICompilerCount=2", + "TestTrans$Test"); + + + OutputAnalyzer output = ProcessTools.executeProcess(pb); + output.reportDiagnosticSummary(); + output.shouldHaveExitValue(0); + output.stdoutShouldContain("JOINED"); + } + + static class Test implements Runnable { + final static int testLoops = 2000; + final static int testSleep = 1; //ms + + public static void main(String[] args) throws Exception { + System.loadLibrary("TestTrans"); + Test test = new Test(); + Thread[] threads = new Thread[64]; + for (int i = 0; i