APIdia Launch Partner
Top Description Fields Constructors Methods
java.lang

pack-priv abstract sealed Class BaseVirtualThread

extends Thread
permits VirtualThread, BoundVirtualThread
Class Inheritance
Known Direct Subclasses
java.lang.ThreadBuilders.BoundVirtualThread, java.lang.VirtualThread

Base class for virtual thread implementations.

Field Summary

Inherited from java.lang.Thread:
interruptedinterruptLockMAX_PRIORITYMIN_PRIORITYNO_INHERIT_THREAD_LOCALSNORM_PRIORITYPRIMORDIAL_TIDthreadLocalRandomProbethreadLocalRandomSecondarySeedthreadLocalRandomSeed

Constructor Summary

AccessConstructor and Description
pack-priv
BaseVirtualThread(String
thread name, can be null
name
,
int
thread characteristics
characteristics
,
boolean
true when bound to an OS thread
bound
)

Initializes a virtual Thread.

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract void
park()

Parks the current virtual thread until the parking permit is available or the thread is interrupted.

pack-priv abstract void
parkNanos(long nanos)

Parks current virtual thread up to the given waiting time until the parking permit is available or the thread is interrupted.

pack-priv abstract void
unpark()

Makes available the parking permit to the given this virtual thread.

Inherited from java.lang.Thread:
activeCountaliveblockedOncheckAccessclearInterruptclearReferencesclonecurrentCarrierThreadcurrentThreaddaemondispatchUncaughtExceptiondumpStackensureMaterializedForStackWalkenumeratefindScopedValueBindingsgenThreadNamegetAllStackTracesgetAllThreadsgetAndClearInterruptgetContextClassLoadergetContinuationgetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerheadStackableScopesholdsLockinheritableThreadLocalsinheritScopedValueBindingsinterruptinterruptedisAliveisDaemonisInterruptedisTerminatedisVirtualjoinjoinjoinjoinnativeThreadIDnioBlockerofPlatformofVirtualonSpinWaitpriorityrunrunWithscopedValueBindingsscopedValueCachesetContextClassLoadersetContinuationsetCurrentThreadsetDaemonsetDefaultUncaughtExceptionHandlersetHeadStackableScopesetInheritableThreadLocalssetInterruptsetNamesetNativeThreadIDsetPrioritysetScopedValueBindingssetScopedValueCachesetTerminatingThreadLocalssetThreadContainersetThreadLocalssetUncaughtExceptionHandlersleepsleepsleepstartstartstartVirtualThreadterminatingThreadLocalsthreadContainerthreadIdthreadLocalsthreadStatetoStringuncaughtExceptionHandlervirtualThreadGroupyield

Constructor Detail

BaseVirtualThreadback to summary
pack-priv BaseVirtualThread(String name, int characteristics, boolean bound)

Initializes a virtual Thread.

Parameters
name:String

thread name, can be null

characteristics:int

thread characteristics

bound:boolean

true when bound to an OS thread

Method Detail

parkback to summary
pack-priv abstract void park()

Parks the current virtual thread until the parking permit is available or the thread is interrupted. The behavior of this method when the current thread is not this thread is not defined.

parkNanosback to summary
pack-priv abstract void parkNanos(long nanos)

Parks current virtual thread up to the given waiting time until the parking permit is available or the thread is interrupted. The behavior of this method when the current thread is not this thread is not defined.

unparkback to summary
pack-priv abstract void unpark()

Makes available the parking permit to the given this virtual thread.