Commit f4e0c04
authored
Update explanation of reentrant locks in Java
Clarified that not all Lock implementations are reentrant, specifically mentioning StampedLock.
原文“JDK 提供的所有现成的 Lock 实现类,包括 synchronized 关键字锁都是可重入的。”不严谨,JDK 中 synchronized、ReentrantLock、ReentrantReadWriteLock 是可重入的;但不能说 JDK 提供的所有锁都是可重入的,StampedLock 就不是。1 parent 01ab2d8 commit f4e0c04
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
782 | | - | |
| 782 | + | |
783 | 783 | | |
784 | 784 | | |
785 | 785 | | |
| |||
0 commit comments