public class Voliate_ {
static int c=0;
public static void main(String[] args) {
new Thread(()->{
try {
Thread.sleep(300);
} catch (InterruptedException e) {
e.printStackTrace();
}
c=20;
},"B").start();
while (c==0){
}
}
}
验证Java内存模型的代码
最新推荐文章于 2024-05-31 10:46:10 发布