23

ReentrantLock (重入锁) 源码浅析-wx5c78c8b1dbb1b的博客

 4 years ago
source link: https://blog.51cto.com/14220760/2391256
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
一、ReentrantLock简介ReentrantLock重入锁,顾名思义,就是支持重入的锁,它表示能够支持一个线程对资源的重复加锁;我们之前学习过Synchronized锁,它也是支持重入的一种锁,参考我的另一篇Synchronized锁的实现原理与应用,Synchronized支持隐式的重入锁,比如递归方法,在方法运行时,执行线程在获取到了锁之后仍能连续多次地获取锁;ReentrantLoc

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK