mirror of
https://gitee.com/dromara/hutool.git
synced 2026-02-09 09:16:26 +08:00
修复 ThreadUtil.getMainThread在JDK25中返回null的问题(pr#1416@Gitee)
This commit is contained in:
@@ -700,7 +700,7 @@ public class ThreadUtil {
|
||||
*/
|
||||
public static Thread getMainThread() {
|
||||
for (final Thread thread : getThreads()) {
|
||||
if (thread.getId() == 1) {
|
||||
if (thread.getId() == 1 || "main".equals(thread.getName())) {
|
||||
return thread;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user