ReentrantLock的实现原理

34 阅读1分钟

ReentrantLock是可重入的,主要利用CAS+AQS队列来实现,支持公平锁和非公平锁,可以设置锁的超时时间

image.png

image.png

image.png

image.png