Top Fields Constructors Methods
sun.nio.ch

public Class NativeThread

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static long
current()

Returns the id of the current native thread if the platform can signal native threads, 0 if the platform can not signal native threads, or -1L if the current thread is a virtual thread.

private static native long
private static native void
init()

pack-priv static boolean
isNativeThread(long tid)

Returns true the tid is the id of a native thread.

pack-priv static boolean
isVirtualThread(long tid)

Returns true if tid is -1L.

public static void
signal(long tid)

Signals the given native thread.

private static native void
signal0(long tid)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

VIRTUAL_THREAD_IDback to summary
private static final long VIRTUAL_THREAD_ID

Constructor Detail

NativeThreadback to summary
public NativeThread()

Method Detail

currentback to summary
public static long current()

Returns the id of the current native thread if the platform can signal native threads, 0 if the platform can not signal native threads, or -1L if the current thread is a virtual thread.

current0back to summary
private static native long current0()
initback to summary
private static native void init()
isNativeThreadback to summary
pack-priv static boolean isNativeThread(long tid)

Returns true the tid is the id of a native thread.

isVirtualThreadback to summary
pack-priv static boolean isVirtualThread(long tid)

Returns true if tid is -1L.

See Also
current()
signalback to summary
public static void signal(long tid)

Signals the given native thread.

Exceptions
IllegalArgumentException:
if tid is not a token to a native thread
signal0back to summary
private static native void signal0(long tid)