Fork me on GitHub
摘要: 首先看两段代码,一段是Integer的,一段是AtomicInteger的,为以下: 以下是AtomicInteger的: 以上两段代码,在使用Integer的时候,必须加上synchronized保证不会出现并发线程同时访问的情况,而在AtomicInteger中却不用加上synchronized 阅读全文
posted @ 2018-02-06 01:00 薄荷加冰2060 阅读(233) 评论(0) 推荐(0)