局部变量的可见性

摘要: 1 问题的引出 局部变量跨线程,又不能用volatile,怎么保证其可见性 2 是否真的能有局部变量跨线程写入? 看一下这段代码: public static void main(String []f) { Integer integer = 1; new Thread(new InnerThrea 阅读全文
posted @ 2021-07-02 17:03 silyvin 阅读(150) 评论(0) 推荐(0)