Modifier and Type | Field and Description |
---|---|
private static final JavaLangAccess |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public static void | |
public static void | park(long
the maximum number of nanoseconds to wait nanos)Parks the current virtual thread up to the given waiting time or until it is unparked or interrupted. |
public static void | parkUntil(long
absolute time, in milliseconds, from the epoch deadline)Parks the current virtual thread until the given deadline or until is is unparked or interrupted. |
public static void |
JLA | back to summary |
---|---|
private static final JavaLangAccess JLA |
VirtualThreads | back to summary |
---|---|
private VirtualThreads() |
park | back to summary |
---|---|
public static void park() Parks the current virtual thread until it is unparked or interrupted. If already unparked then the parking permit is consumed and this method completes immediately (meaning it doesn't yield). It also completes immediately if the interrupt status is set.
|
park | back to summary |
---|---|
public static void park(long nanos) Parks the current virtual thread up to the given waiting time or until it
is unparked or interrupted. If already unparked then the parking permit is
consumed and this method completes immediately (meaning it doesn't yield).
It also completes immediately if the interrupt status is set or the waiting
time is
|
parkUntil | back to summary |
---|---|
public static void parkUntil(long deadline) Parks the current virtual thread until the given deadline or until is is unparked or interrupted. If already unparked then the parking permit is consumed and this method completes immediately (meaning it doesn't yield). It also completes immediately if the interrupt status is set or the deadline has past.
|
unpark | back to summary |
---|---|
public static void unpark(Thread thread) Re-enables a virtual thread for scheduling. If the thread was parked then it will be unblocked, otherwise its next attempt to park will not block
|