13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.internal.access;
27
28 import java.io.InputStream;
29 import java.lang.annotation.Annotation;
30 import java.lang.invoke.MethodHandle;
31 import java.lang.invoke.MethodType;
32 import java.lang.module.ModuleDescriptor;
33 import java.lang.reflect.Executable;
34 import java.lang.reflect.Method;
35 import java.net.URI;
36 import java.nio.charset.CharacterCodingException;
37 import java.nio.charset.Charset;
38 import java.security.AccessControlContext;
39 import java.security.ProtectionDomain;
40 import java.util.List;
41 import java.util.Map;
42 import java.util.Set;
43 import java.util.concurrent.Callable;
44 import java.util.concurrent.ConcurrentHashMap;
45 import java.util.concurrent.RejectedExecutionException;
46 import java.util.stream.Stream;
47
48 import jdk.internal.misc.CarrierThreadLocal;
49 import jdk.internal.module.ServicesCatalog;
50 import jdk.internal.reflect.ConstantPool;
51 import jdk.internal.vm.Continuation;
52 import jdk.internal.vm.ContinuationScope;
547 * @param nanos the maximum number of nanoseconds to wait
548 * @throws WrongThreadException if the current thread is not a virtual thread
549 */
550 void parkVirtualThread(long nanos);
551
552 /**
553 * Re-enables a virtual thread for scheduling. If the thread was parked then
554 * it will be unblocked, otherwise its next attempt to park will not block
555 * @param thread the virtual thread to unpark
556 * @throws IllegalArgumentException if the thread is not a virtual thread
557 * @throws RejectedExecutionException if the scheduler cannot accept a task
558 */
559 void unparkVirtualThread(Thread thread);
560
561 /**
562 * Creates a new StackWalker
563 */
564 StackWalker newStackWalkerInstance(Set<StackWalker.Option> options,
565 ContinuationScope contScope,
566 Continuation continuation);
567 /**
568 * Returns '<loader-name>' @<id> if classloader has a name
569 * explicitly set otherwise <qualified-class-name> @<id>
570 */
571 String getLoaderNameID(ClassLoader loader);
572 }
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.internal.access;
27
28 import java.io.InputStream;
29 import java.lang.annotation.Annotation;
30 import java.lang.invoke.MethodHandle;
31 import java.lang.invoke.MethodType;
32 import java.lang.module.ModuleDescriptor;
33 import java.lang.reflect.ClassFileFormatVersion;
34 import java.lang.reflect.Executable;
35 import java.lang.reflect.Method;
36 import java.net.URI;
37 import java.nio.charset.CharacterCodingException;
38 import java.nio.charset.Charset;
39 import java.security.AccessControlContext;
40 import java.security.ProtectionDomain;
41 import java.util.List;
42 import java.util.Map;
43 import java.util.Set;
44 import java.util.concurrent.Callable;
45 import java.util.concurrent.ConcurrentHashMap;
46 import java.util.concurrent.RejectedExecutionException;
47 import java.util.stream.Stream;
48
49 import jdk.internal.misc.CarrierThreadLocal;
50 import jdk.internal.module.ServicesCatalog;
51 import jdk.internal.reflect.ConstantPool;
52 import jdk.internal.vm.Continuation;
53 import jdk.internal.vm.ContinuationScope;
548 * @param nanos the maximum number of nanoseconds to wait
549 * @throws WrongThreadException if the current thread is not a virtual thread
550 */
551 void parkVirtualThread(long nanos);
552
553 /**
554 * Re-enables a virtual thread for scheduling. If the thread was parked then
555 * it will be unblocked, otherwise its next attempt to park will not block
556 * @param thread the virtual thread to unpark
557 * @throws IllegalArgumentException if the thread is not a virtual thread
558 * @throws RejectedExecutionException if the scheduler cannot accept a task
559 */
560 void unparkVirtualThread(Thread thread);
561
562 /**
563 * Creates a new StackWalker
564 */
565 StackWalker newStackWalkerInstance(Set<StackWalker.Option> options,
566 ContinuationScope contScope,
567 Continuation continuation);
568
569 /**
570 * {@return the primary class for a primitive class}
571 *
572 * @param klass a class
573 */
574 Class<?> asPrimaryType(Class<?> klass);
575
576 /**
577 * {@return the value type of a primitive class}
578 *
579 * @param klass a class
580 */
581 Class<?> asValueType(Class<?> klass);
582
583 /**
584 * {@return true if the class is the primary type of a primitive class}
585 *
586 * @param klass a class
587 */
588 boolean isPrimaryType(Class<?> klass);
589
590 /**
591 * {@return true if the class is the primary type of a primitive class}
592 *
593 * @param klass a class
594 */
595 boolean isPrimitiveValueType(Class<?> klass);
596
597 /**
598 * Returns {@code true} if this class is a primitive class.
599 */
600 boolean isPrimitiveClass(Class<?> klass);
601
602 /**
603 * Returns the class file format version of the class.
604 */
605 int classFileFormatVersion(Class<?> klass);
606
607 /**
608 * Returns '<loader-name>' @<id> if classloader has a name
609 * explicitly set otherwise <qualified-class-name> @<id>
610 */
611 String getLoaderNameID(ClassLoader loader);
612 }
|