< prev index next >

test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadStateMountedTest/GetThreadStateMountedTest.java

Print this page
*** 249,17 ***
          if (errCount > 0) {
              throw new RuntimeException("Test failed, " + errCount + " errors");
          }
      }
  
      private static Thread createPinnedVThread(Runnable runnable) {
!         final Object syncObj = new Object();
!         return Thread.ofVirtual().unstarted(() -> {
!             synchronized (syncObj) {
!                 runnable.run();
!             }
-         });
      }
  
      // Native implementation of suspendWaiting.
      // Returns false if the method is not able to reach the desired state in several tries.
      private static native boolean trySuspendInWaitingState(Thread vthread);
--- 249,18 ---
          if (errCount > 0) {
              throw new RuntimeException("Test failed, " + errCount + " errors");
          }
      }
  
+     private static native void runFromNative(Runnable runnable);
+ 
      private static Thread createPinnedVThread(Runnable runnable) {
!         return Thread.ofVirtual().unstarted(() -> runFromNative(runnable));
!     }
! 
!     private static void runUpcall(Runnable runnable) {
!         runnable.run();
      }
  
      // Native implementation of suspendWaiting.
      // Returns false if the method is not able to reach the desired state in several tries.
      private static native boolean trySuspendInWaitingState(Thread vthread);
< prev index next >