Skip to content

Commit

Permalink
rearrange to avoid long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
jia-wei-tang committed Aug 2, 2024
1 parent 64e40a6 commit 80b139e
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}
Expand All @@ -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();
}
Expand Down

0 comments on commit 80b139e

Please sign in to comment.