Skip to content

Commit 74efc2e

Browse files
committed
Update ThreadUtils.java
1 parent 5cee289 commit 74efc2e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/main/java/io/github/intisy/utils/utils/ThreadUtils.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ public static void sleep(int milliseconds) {
1515
}
1616
}
1717

18+
public static void newThread(Runnable runnable) {
19+
new Thread(runnable).start();
20+
}
21+
public static void newThread(Runnable runnable, String name) {
22+
new Thread(runnable, name).start();
23+
}
24+
public static void newThread(Runnable runnable, String name, boolean daemon) {
25+
Thread thread = new Thread(runnable, name);
26+
thread.setDaemon(daemon);
27+
thread.start();
28+
}
29+
1830
public static String getThreadName() {
1931
return Thread.currentThread().getName();
2032
}

0 commit comments

Comments
 (0)