Modifier and Type | Class and Description |
---|---|
private static class | ThreadBuilders.
Base class for Thread.Builder implementations. |
private abstract static class | ThreadBuilders.
Base ThreadFactory implementation. |
pack-priv static class | ThreadBuilders.
A "virtual thread" that is backed by a platform thread. |
pack-priv static class | ThreadBuilders.
ThreadBuilder.OfPlatform implementation. |
private static class | ThreadBuilders.
ThreadFactory for platform threads. |
pack-priv static class | ThreadBuilders.
ThreadBuilder.OfVirtual implementation. |
private static class | ThreadBuilders.
ThreadFactory for virtual threads. |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
pack-priv static Thread | newVirtualThread(Executor scheduler, String name, int characteristics, Runnable task)
Creates a new virtual thread to run the given task. |
ThreadBuilders | back to summary |
---|---|
private ThreadBuilders() |
newVirtualThread | back to summary |
---|---|
pack-priv static Thread newVirtualThread(Executor scheduler, String name, int characteristics, Runnable task) Creates a new virtual thread to run the given task. |
Modifier and Type | Field and Description |
---|---|
private int | |
private long | |
private String | |
private Thread. |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
pack-priv int | |
pack-priv long | |
pack-priv String | |
pack-priv String | |
pack-priv void | |
pack-priv void | |
pack-priv void | |
pack-priv void | |
pack-priv Thread. |
characteristics | back to summary |
---|---|
private int characteristics |
counter | back to summary |
---|---|
private long counter |
name | back to summary |
---|---|
private String name |
uhe | back to summary |
---|---|
private Thread. |
BaseThreadBuilder | back to summary |
---|---|
private BaseThreadBuilder() |
characteristics | back to summary |
---|---|
pack-priv int characteristics() |
counter | back to summary |
---|---|
pack-priv long counter() |
name | back to summary |
---|---|
pack-priv String name() |
nextThreadName | back to summary |
---|---|
pack-priv String nextThreadName() |
setInheritInheritableThreadLocals | back to summary |
---|---|
pack-priv void setInheritInheritableThreadLocals(boolean inherit) |
setName | back to summary |
---|---|
pack-priv void setName(String name) |
setName | back to summary |
---|---|
pack-priv void setName(String prefix, long start) |
setUncaughtExceptionHandler | back to summary |
---|---|
pack-priv void setUncaughtExceptionHandler(Thread. |
uncaughtExceptionHandler | back to summary |
---|---|
pack-priv Thread. |
Modifier and Type | Field and Description |
---|---|
private final int | |
private static final VarHandle | |
private volatile long | |
private final boolean | |
private final String | |
private final Thread. |
Access | Constructor and Description |
---|---|
pack-priv | BaseThreadFactory(String name, long start, int characteristics, Thread.
|
Modifier and Type | Method and Description |
---|---|
pack-priv int | |
pack-priv String | |
pack-priv Thread. |
characteristics | back to summary |
---|---|
private final int characteristics |
COUNT | back to summary |
---|---|
private static final VarHandle COUNT |
count | back to summary |
---|---|
private volatile long count |
hasCounter | back to summary |
---|---|
private final boolean hasCounter |
name | back to summary |
---|---|
private final String name |
uhe | back to summary |
---|---|
private final Thread. |
BaseThreadFactory | back to summary |
---|---|
pack-priv BaseThreadFactory(String name, long start, int characteristics, Thread. |
characteristics | back to summary |
---|---|
pack-priv int characteristics() |
nextThreadName | back to summary |
---|---|
pack-priv String nextThreadName() |
uncaughtExceptionHandler | back to summary |
---|---|
pack-priv Thread. |
Modifier and Type | Field and Description |
---|---|
private boolean | |
private final Runnable | |
private static final Unsafe |
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
pack-priv void | park()
Implements abstract java. Parks the current virtual thread until the parking permit is available or the thread is interrupted. |
pack-priv void | parkNanos(long nanos)
Implements abstract java. Parks current virtual thread up to the given waiting time until the parking permit is available or the thread is interrupted. |
public void | run()
Overrides java. Implements java. This method is run by the thread when it executes. |
public String | |
pack-priv void | unpark()
Implements abstract java. Makes available the parking permit to the given this virtual thread. |
runInvoked | back to summary |
---|---|
private boolean runInvoked |
task | back to summary |
---|---|
private final Runnable task |
U | back to summary |
---|---|
private static final Unsafe U |
BoundVirtualThread | back to summary |
---|---|
pack-priv BoundVirtualThread(String name, int characteristics, Runnable task) |
park | back to summary |
---|---|
pack-priv void park() Implements abstract java. Doc from java. 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.
|
parkNanos | back to summary |
---|---|
pack-priv void parkNanos(long nanos) Implements abstract java. Doc from java. 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.
|
run | back to summary |
---|---|
public void run() Overrides java. Implements java. Doc from java. This method is run by the thread when it executes. Subclasses of This method is not intended to be invoked directly. If this thread is a
platform thread created with a
|
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of this thread. The string representation will usually include the thread's identifier and name. The default implementation for platform threads includes the thread's identifier, name, priority, and the name of the thread group. |
unpark | back to summary |
---|---|
pack-priv void unpark() Implements abstract java. Doc from java. Makes available the parking permit to the given this virtual thread.
|
Modifier and Type | Field and Description |
---|---|
private boolean | |
private boolean | |
private ThreadGroup | |
private int | |
private long |
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
public Thread. | daemon(boolean
true to create daemon threadsImplements java. Sets the daemon status. |
public ThreadFactory | factory()
Implements java. Returns a |
public Thread. | group(ThreadGroup
the thread group group)Implements java. Sets the thread group. |
public Thread. | inheritInheritableThreadLocals(boolean
true to inherit, false to not inheritImplements java. Sets whether the thread inherits the initial values of inheritable-thread-local variables from the constructing thread. |
public Thread. | name(String
thread name name)Implements java. Sets the thread name. |
public Thread. | name(String
thread name prefix prefix, long the starting value of the counter start)Implements java. Sets the thread name to be the concatenation of a string prefix and the string representation of a counter value. |
pack-priv String | |
public Thread. | priority(int
priority priority)Implements java. Sets the thread priority. |
public Thread. | stackSize(long
the desired stack size stackSize)Implements java. Sets the desired stack size. |
public Thread | start(Runnable
the object to run when the thread executes task)Implements java. Creates a new |
public Thread. | uncaughtExceptionHandler(Thread.
uncaught exception handler uehImplements java. Sets the uncaught exception handler. |
public Thread | unstarted(Runnable
the object to run when the thread executes task)Implements java. Creates a new |
daemon | back to summary |
---|---|
private boolean daemon |
daemonChanged | back to summary |
---|---|
private boolean daemonChanged |
group | back to summary |
---|---|
private ThreadGroup group |
priority | back to summary |
---|---|
private int priority |
stackSize | back to summary |
---|---|
private long stackSize |
PlatformThreadBuilder | back to summary |
---|---|
pack-priv PlatformThreadBuilder() |
daemon | back to summary |
---|---|
public Thread. Implements java. Doc from java. Sets the daemon status.
|
factory | back to summary |
---|---|
public ThreadFactory factory() Implements java. Doc from java. Returns a
|
group | back to summary |
---|---|
public Thread. Implements java. Doc from java. Sets the thread group.
|
inheritInheritableThreadLocals | back to summary |
---|---|
public Thread. Implements java. Doc from java. Sets whether the thread inherits the initial values of inheritable-thread-local variables from the constructing thread. The default is to inherit.
|
name | back to summary |
---|---|
public Thread. Implements java. Doc from java. Sets the thread name.
|
name | back to summary |
---|---|
public Thread. Implements java. Doc from java. Sets the thread name to be the concatenation of a string prefix and
the string representation of a counter value. The counter's initial
value is
|
nextThreadName | back to summary |
---|---|
pack-priv String nextThreadName() Overrides java.
|
priority | back to summary |
---|---|
public Thread. Implements java. Doc from java. Sets the thread priority.
|
stackSize | back to summary |
---|---|
public Thread. Implements java. Doc from java. Sets the desired stack size. The stack size is the approximate number of bytes of address space
that the Java virtual machine is to allocate for the thread's stack. The
effect is highly platform dependent and the Java virtual machine is free
to treat the
|
start | back to summary |
---|---|
public Thread start(Runnable task) Implements java. Doc from java. Creates a new |
uncaughtExceptionHandler | back to summary |
---|---|
public Thread. Implements java. Doc from java. Sets the uncaught exception handler.
|
unstarted | back to summary |
---|---|
public Thread unstarted(Runnable task) Implements java. Doc from java. Creates a new |
Modifier and Type | Field and Description |
---|---|
private final boolean | |
private final boolean | |
private final ThreadGroup | |
private final int | |
private final long |
Access | Constructor and Description |
---|---|
pack-priv | PlatformThreadFactory(ThreadGroup group, String name, long start, int characteristics, boolean daemonChanged, boolean daemon, int priority, long stackSize, Thread.
|
Modifier and Type | Method and Description |
---|---|
public Thread | newThread(Runnable
a runnable to be executed by new thread instance task)Implements java. Constructs a new unstarted |
pack-priv String |
daemon | back to summary |
---|---|
private final boolean daemon |
daemonChanged | back to summary |
---|---|
private final boolean daemonChanged |
group | back to summary |
---|---|
private final ThreadGroup group |
priority | back to summary |
---|---|
private final int priority |
stackSize | back to summary |
---|---|
private final long stackSize |
PlatformThreadFactory | back to summary |
---|---|
pack-priv PlatformThreadFactory(ThreadGroup group, String name, long start, int characteristics, boolean daemonChanged, boolean daemon, int priority, long stackSize, Thread. |
newThread | back to summary |
---|---|
public Thread newThread(Runnable task) Implements java. Doc from java. Constructs a new unstarted |
nextThreadName | back to summary |
---|---|
pack-priv String nextThreadName() Overrides java.
|
Access | Constructor and Description |
---|---|
pack-priv | |
pack-priv |
Modifier and Type | Method and Description |
---|---|
public ThreadFactory | factory()
Implements java. Returns a |
public Thread. | inheritInheritableThreadLocals(boolean
true to inherit, false to not inheritImplements java. Sets whether the thread inherits the initial values of inheritable-thread-local variables from the constructing thread. |
public Thread. | name(String
thread name name)Implements java. Sets the thread name. |
public Thread. | name(String
thread name prefix prefix, long the starting value of the counter start)Implements java. Sets the thread name to be the concatenation of a string prefix and the string representation of a counter value. |
public Thread | start(Runnable
the object to run when the thread executes task)Implements java. Creates a new |
public Thread. | uncaughtExceptionHandler(Thread.
uncaught exception handler uehImplements java. Sets the uncaught exception handler. |
public Thread | unstarted(Runnable
the object to run when the thread executes task)Implements java. Creates a new |
scheduler | back to summary |
---|---|
private Executor scheduler |
VirtualThreadBuilder | back to summary |
---|---|
pack-priv VirtualThreadBuilder() |
VirtualThreadBuilder | back to summary |
---|---|
pack-priv VirtualThreadBuilder(Executor scheduler) |
factory | back to summary |
---|---|
public ThreadFactory factory() Implements java. Doc from java. Returns a
|
inheritInheritableThreadLocals | back to summary |
---|---|
public Thread. Implements java. Doc from java. Sets whether the thread inherits the initial values of inheritable-thread-local variables from the constructing thread. The default is to inherit. |
name | back to summary |
---|---|
public Thread. Implements java. Doc from java. Sets the thread name. |
name | back to summary |
---|---|
public Thread. Implements java. Doc from java. Sets the thread name to be the concatenation of a string prefix and
the string representation of a counter value. The counter's initial
value is |
start | back to summary |
---|---|
public Thread start(Runnable task) Implements java. Doc from java. Creates a new |
uncaughtExceptionHandler | back to summary |
---|---|
public Thread. Implements java. Doc from java. Sets the uncaught exception handler. |
unstarted | back to summary |
---|---|
public Thread unstarted(Runnable task) Implements java. Doc from java. Creates a new |
Access | Constructor and Description |
---|---|
pack-priv | VirtualThreadFactory(Executor scheduler, String name, long start, int characteristics, Thread.
|
Modifier and Type | Method and Description |
---|---|
public Thread | newThread(Runnable
a runnable to be executed by new thread instance task)Implements java. Constructs a new unstarted |
scheduler | back to summary |
---|---|
private final Executor scheduler |
VirtualThreadFactory | back to summary |
---|---|
pack-priv VirtualThreadFactory(Executor scheduler, String name, long start, int characteristics, Thread. |
newThread | back to summary |
---|---|
public Thread newThread(Runnable task) Implements java. Doc from java. Constructs a new unstarted |