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.foreign.MemorySegment;
31 import java.lang.invoke.MethodHandle;
32 import java.lang.invoke.MethodType;
33 import java.lang.module.ModuleDescriptor;
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;
560 * @param nanos the maximum number of nanoseconds to wait
561 * @throws WrongThreadException if the current thread is not a virtual thread
562 */
563 void parkVirtualThread(long nanos);
564
565 /**
566 * Re-enables a virtual thread for scheduling. If the thread was parked then
567 * it will be unblocked, otherwise its next attempt to park will not block
568 * @param thread the virtual thread to unpark
569 * @throws IllegalArgumentException if the thread is not a virtual thread
570 * @throws RejectedExecutionException if the scheduler cannot accept a task
571 */
572 void unparkVirtualThread(Thread thread);
573
574 /**
575 * Creates a new StackWalker
576 */
577 StackWalker newStackWalkerInstance(Set<StackWalker.Option> options,
578 ContinuationScope contScope,
579 Continuation continuation);
580 /**
581 * Returns '<loader-name>' @<id> if classloader has a name
582 * explicitly set otherwise <qualified-class-name> @<id>
583 */
584 String getLoaderNameID(ClassLoader loader);
585
586 /**
587 * Copy the string bytes to an existing segment, avoiding intermediate copies.
588 */
589 void copyToSegmentRaw(String string, MemorySegment segment, long offset);
590
591 /**
592 * Are the string bytes compatible with the given charset?
593 */
594 boolean bytesCompatible(String string, Charset charset);
595
596 /**
597 * Is a security manager already set or allowed to be set
598 * (using -Djava.security.manager=allow)?
599 */
|
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.foreign.MemorySegment;
31 import java.lang.invoke.MethodHandle;
32 import java.lang.invoke.MethodType;
33 import java.lang.module.ModuleDescriptor;
34 import java.lang.reflect.ClassFileFormatVersion;
35 import java.lang.reflect.Executable;
36 import java.lang.reflect.Method;
37 import java.net.URI;
38 import java.nio.charset.CharacterCodingException;
39 import java.nio.charset.Charset;
40 import java.security.AccessControlContext;
41 import java.security.ProtectionDomain;
42 import java.util.List;
43 import java.util.Map;
44 import java.util.Set;
45 import java.util.concurrent.Callable;
46 import java.util.concurrent.ConcurrentHashMap;
47 import java.util.concurrent.RejectedExecutionException;
48 import java.util.stream.Stream;
49
50 import jdk.internal.misc.CarrierThreadLocal;
51 import jdk.internal.module.ServicesCatalog;
52 import jdk.internal.reflect.ConstantPool;
53 import jdk.internal.vm.Continuation;
54 import jdk.internal.vm.ContinuationScope;
561 * @param nanos the maximum number of nanoseconds to wait
562 * @throws WrongThreadException if the current thread is not a virtual thread
563 */
564 void parkVirtualThread(long nanos);
565
566 /**
567 * Re-enables a virtual thread for scheduling. If the thread was parked then
568 * it will be unblocked, otherwise its next attempt to park will not block
569 * @param thread the virtual thread to unpark
570 * @throws IllegalArgumentException if the thread is not a virtual thread
571 * @throws RejectedExecutionException if the scheduler cannot accept a task
572 */
573 void unparkVirtualThread(Thread thread);
574
575 /**
576 * Creates a new StackWalker
577 */
578 StackWalker newStackWalkerInstance(Set<StackWalker.Option> options,
579 ContinuationScope contScope,
580 Continuation continuation);
581
582 /**
583 * Returns the class file format version of the class.
584 */
585 int classFileFormatVersion(Class<?> klass);
586
587 /**
588 * Returns '<loader-name>' @<id> if classloader has a name
589 * explicitly set otherwise <qualified-class-name> @<id>
590 */
591 String getLoaderNameID(ClassLoader loader);
592
593 /**
594 * Copy the string bytes to an existing segment, avoiding intermediate copies.
595 */
596 void copyToSegmentRaw(String string, MemorySegment segment, long offset);
597
598 /**
599 * Are the string bytes compatible with the given charset?
600 */
601 boolean bytesCompatible(String string, Charset charset);
602
603 /**
604 * Is a security manager already set or allowed to be set
605 * (using -Djava.security.manager=allow)?
606 */
|