1. 实例代码
public class SpinLockDemo {
public static void main(String[] args) {
Thread thread = Thread.currentThread();
System.out.println("当前线程名字:"+ thread);
}
}
2.运行结果
3.说明
[线程名称, 线程优先级, 线程所属线程组]
public class SpinLockDemo {
public static void main(String[] args) {
Thread thread = Thread.currentThread();
System.out.println("当前线程名字:"+ thread);
}
}
[线程名称, 线程优先级, 线程所属线程组]