< prev index next >

test/jdk/java/lang/Thread/virtual/HoldsLock.java

Print this page
*** 53,10 ***
--- 53,11 ---
  import java.util.concurrent.atomic.AtomicReference;
  
  import org.junit.jupiter.api.Test;
  import org.junit.jupiter.api.Disabled;
  import static org.junit.jupiter.api.Assertions.*;
+ import static org.junit.jupiter.api.Assumptions.*;
  
  class HoldsLock {
      static final Object LOCK1 = new Object();
      static final Object LOCK2 = new Object();
  

*** 86,10 ***
--- 87,12 ---
          stop(carrier);
      }
  
      @Test
      void testThreadInfo() throws Exception {
+         assumeFalse(Thread.currentThread().isVirtual(), "Main thread must be platform thread");
+ 
          var q = new ArrayBlockingQueue<Runnable>(5);
  
          Thread carrier = spawnCarrier(q);
          Thread vthread = spawnVirtual(executor(q), () -> {
              synchronized (LOCK1) {
< prev index next >