摘要: protected final boolean compareAndSetState(int expect, int update) { // See below for intrinsics setup to support this return unsafe.compareAndSwapInt 阅读全文
posted @ 2020-06-25 12:06 zpp13 阅读(148) 评论(0) 推荐(0) 编辑
摘要: ReentrantLock:表示重入锁,它是唯一一个实现了Lock接口的类。重入锁指的是 线程在获得锁之后,再次获取该锁不需要阻塞,而是直接关联一次计数器增加重入次; syschronized和reenttrantlock都支持重入锁; 重入锁的设计目的 比如调用demo方法获得了当前的对象锁,然后 阅读全文
posted @ 2020-06-25 10:26 zpp13 阅读(1975) 评论(1) 推荐(0) 编辑