Package com.illumon.util.thread
Class ThreadUtils
java.lang.Object
com.illumon.util.thread.ThreadUtils
Collection of thread related utility methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ThreadnewDaemonThread(@NotNull Runnable r) Create a thread and make it a daemon.static ThreadnewDaemonThread(@NotNull Runnable r, @NotNull String name) Create a thread, name it, and make it a daemon.static ThreadstartDaemonThread(@NotNull Runnable target, @NotNull String name) Create a named daemon thread and start it.
-
Constructor Details
-
ThreadUtils
public ThreadUtils()
-
-
Method Details
-
newDaemonThread
Create a thread and make it a daemon.- Parameters:
r- the runnable to pass the new Thread- Returns:
- the created thread
-
newDaemonThread
Create a thread, name it, and make it a daemon.- Parameters:
r- the runnable to pass the new Threadname- the name of the thread- Returns:
- the created thread
-
startDaemonThread
public static Thread startDaemonThread(@NotNull @NotNull Runnable target, @NotNull @NotNull String name) Create a named daemon thread and start it.- Parameters:
target- the runnable to pass the new Threadname- the name of the thread- Returns:
- the created thread, started
-