< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/share/runner/RunParams.java

Print this page
*** 39,10 ***
--- 39,11 ---
          private boolean runFinDiagThread = false;
          private boolean runAllDiagThread = false;
          private boolean runForever = false;
          private long threadBlockSize = 64 * 1024 * 1024;
          private boolean interruptThreads = false;
+         private boolean useVirtualThreads = false;
  
          public RunParams() {
                  this(new StressOptions());
          }
  

*** 189,10 ***
--- 190,14 ---
  
          public final StressOptions getStressOptions() {
                  return stressOptions;
          }
  
+         public final boolean useVirtualThreads() {
+                 return this.useVirtualThreads;
+         }
+ 
          public void parseCommandLine(String[] args) {
                  if (args == null)
                          return;
                  stressOptions.parseCommandLine(args);
                  for (int i = 0; i < args.length; ++i) {

*** 208,17 ***
--- 213,23 ---
                                  runMemDiagThread = false;
                          else if (args[i].equals("-Df1"))
                                  runFinDiagThread = true;
                          else if (args[i].equals("-Df"))
                                  runFinDiagThread = true;
+                         else if (args[i].equals("-v"))
+                             useVirtualThreads = true;
                          else if (args[i].equals("-t"))
                                  numberOfThreads = Integer.parseInt(args[++i]);
                          else if (args[i].equals("-it"))
                                  interruptThreads = true;
                          else if (args[i].equals("-iterations"))
                                  iterations = Integer.parseInt(args[++i]);
                  }
+                 // Allow to force using vthreads using wrapper property
+                 if(System.getProperty("main.wrapper") != null && System.getProperty("main.wrapper").equals("Virtual")) {
+                         useVirtualThreads = true;
+                 }
                  printConfig(System.out);
          }
  
          public void prinUsage() {
          }
< prev index next >