< prev index next >

src/java.base/share/classes/jdk/internal/vm/ContinuationSupport.java

Print this page
*** 48,7 ***
--- 48,20 ---
          if (!isSupported()) {
              throw new UnsupportedOperationException("VM does not support continuations");
          }
      }
  
+     /**
+      * Pins the current continuation if the VM has continuations support.
+      * @return true if pinned or there is no current continuation
+      */
+     public static boolean pinIfSupported() {
+         if (ContinuationSupport.isSupported()) {
+             Continuation.pin();
+             return true;
+         } else {
+             return false;
+         }
+     }
+ 
      private static native boolean isSupported0();
  }
< prev index next >