< prev index next >

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

Print this page

33     private ContinuationSupport() {
34     }
35 
36     /**
37      * Return true if the VM has continuations support.
38      */
39     public static boolean isSupported() {
40         return SUPPORTED;
41     }
42 
43     /**
44      * Ensures that VM has continuations support.
45      * @throws UnsupportedOperationException if not supported
46      */
47     public static void ensureSupported() {
48         if (!isSupported()) {
49             throw new UnsupportedOperationException("VM does not support continuations");
50         }
51     }
52 













53     private static native boolean isSupported0();
54 }

33     private ContinuationSupport() {
34     }
35 
36     /**
37      * Return true if the VM has continuations support.
38      */
39     public static boolean isSupported() {
40         return SUPPORTED;
41     }
42 
43     /**
44      * Ensures that VM has continuations support.
45      * @throws UnsupportedOperationException if not supported
46      */
47     public static void ensureSupported() {
48         if (!isSupported()) {
49             throw new UnsupportedOperationException("VM does not support continuations");
50         }
51     }
52 
53     /**
54      * Pins the current continuation if the VM has continuations support.
55      * @return true if pinned or there is no current continuation
56      */
57     public static boolean pinIfSupported() {
58         if (ContinuationSupport.isSupported()) {
59             Continuation.pin();
60             return true;
61         } else {
62             return false;
63         }
64     }
65 
66     private static native boolean isSupported0();
67 }
< prev index next >