3 线程组和线程优先级
3.1 线程组(ThreadGroup)
public class Demo {
public static void main(String[] args) {
Thread testThread = new Thread(() -> {
System.out.println("testThread当前线程组名字:" +
Thread.currentThread().getThreadGroup().getName());
System.out.println("testThread线程名字:" +
Thread.currentThread().getName());
});
testThread.start();
System.out.println("执行main方法线程名字:" + Thread.currentThread().getName());
}
}3.2 线程的优先级
3.3 线程组的常用方法及数据结构
3.3.1 线程组的常用方法
3.3.2 线程组的数据结构
Last updated
Was this helpful?