From 80b139effb2da776b0d9d76ef2249417be524fa4 Mon Sep 17 00:00:00 2001 From: Jiawei Tang Date: Fri, 2 Aug 2024 11:18:22 +0800 Subject: [PATCH] rearrange to avoid long lines --- .../TestPinCaseWithCFLH/TestPinCaseWithCFLH.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/serviceability/jvmti/vthread/TestPinCaseWithCFLH/TestPinCaseWithCFLH.java b/test/hotspot/jtreg/serviceability/jvmti/vthread/TestPinCaseWithCFLH/TestPinCaseWithCFLH.java index 58218f4142bd4..30327b29d7840 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/vthread/TestPinCaseWithCFLH/TestPinCaseWithCFLH.java +++ b/test/hotspot/jtreg/serviceability/jvmti/vthread/TestPinCaseWithCFLH/TestPinCaseWithCFLH.java @@ -28,7 +28,11 @@ * @requires vm.continuations * @modules java.base/java.lang:+open * @build TestPinCaseWithCFLH - * @run main/othervm/timeout=100 -Djdk.virtualThreadScheduler.maxPoolSize=1 -Djdk.tracePinnedThreads=full --enable-native-access=ALL-UNNAMED -javaagent:TestPinCaseWithCFLH.jar TestPinCaseWithCFLH +* @run driver jdk.test.lib.util.JavaAgentBuilder + * TestPinCaseWithCFLH TestPinCaseWithCFLH.jar + * @run main/othervm/timeout=100 -Djdk.virtualThreadScheduler.maxPoolSize=1 + * -Djdk.tracePinnedThreads=full --enable-native-access=ALL-UNNAMED + * -javaagent:TestPinCaseWithCFLH.jar TestPinCaseWithCFLH */ import java.lang.instrument.ClassFileTransformer; import java.lang.instrument.IllegalClassFormatException; @@ -39,7 +43,9 @@ public class TestPinCaseWithCFLH { public static class TestClassFileTransformer implements ClassFileTransformer { - public byte[] transform(ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException { + public byte[] transform(ClassLoader loader, String className, Class classBeingRedefined, + ProtectionDomain protectionDomain, byte[] classfileBuffer) + throws IllegalClassFormatException { return classfileBuffer; } } @@ -55,7 +61,10 @@ public static void main(String[] args) throws Exception{ Thread t1 = Thread.ofVirtual().name("vthread-1").start(() -> { VThreadPinner.runPinned(() -> { try { - Thread.sleep(500); // try yield, will pin, javaagent + tracePinnedThreads should not lead to crash (because of the class `PinnedThreadPrinter`) + // try yield, will pin, + // javaagent + tracePinnedThreads should not lead to crash + // (because of the class `PinnedThreadPrinter`) + Thread.sleep(500); } catch (Exception e) { e.printStackTrace(); }