Package org.jgroups.util
Class ThreadCreator
- java.lang.Object
-
- org.jgroups.util.ThreadCreator
-
public class ThreadCreator extends java.lang.Object
- Since:
- Helper class to create regular or virtual threads. Virtual threads are not supported for versions less than Java 17.
- Author:
- Bela Ban
-
-
Constructor Summary
Constructors Constructor Description ThreadCreator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Thread
createThread(java.lang.Runnable r, java.lang.String name, boolean daemon, boolean virtual)
protected static java.lang.invoke.MethodHandle
getCreateVThreadHandle()
protected static java.lang.Class<?>
getOfVirtualClass()
protected static java.lang.invoke.MethodHandle
getOfVirtualHandle()
static boolean
hasVirtualThreads()
protected static java.lang.Thread
newVirtualThread(java.lang.Runnable r)
-
-
-
Method Detail
-
hasVirtualThreads
public static boolean hasVirtualThreads()
-
createThread
public static java.lang.Thread createThread(java.lang.Runnable r, java.lang.String name, boolean daemon, boolean virtual)
-
newVirtualThread
protected static java.lang.Thread newVirtualThread(java.lang.Runnable r)
-
getCreateVThreadHandle
protected static java.lang.invoke.MethodHandle getCreateVThreadHandle()
-
getOfVirtualClass
protected static java.lang.Class<?> getOfVirtualClass()
-
getOfVirtualHandle
protected static java.lang.invoke.MethodHandle getOfVirtualHandle()
-
-