摘要: import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; public class Solution { private int start = 1; /** * 对flag的写入虽然加锁保证了线程安全,但由于读取时不是volatile所以... 阅读全文
posted @ 2019-02-22 17:10 Roni_i 阅读(630) 评论(0) 推荐(0) 编辑