摘要:
这个锁叫可重入锁。它其实语义上和synchronized差不多,但是添加了一些拓展的特性。A reentrant mutual exclusionLockwith the same basic behavior and semantics as the implicit monitor lock accessed usingsynchronizedmethods and statements, but with extended capabilities.我们重点看看它的源代码实现。在ReentrantLock类中很大一部分的函数是委托给这个类Sync来完成的。 /** Synchron... 阅读全文