Skip to content

Commit 6df0c44

Browse files
committed
重入锁
1 parent 16cfc12 commit 6df0c44

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

MD/ReentrantLock.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ ReentrantLock 分为**公平锁**和**非公平锁**,可以通过构造方法
9494
}
9595
```
9696

97-
首先会判断 `AQS` 中的 `state` 是否等于0,0 就表示当前没有其他线程获得锁,当前线程就可以尝试获取锁。
97+
首先会判断 `AQS` 中的 `state` 是否等于 0,0 表示当前没有其他线程获得锁,当前线程就可以尝试获取锁。
9898

9999
注意:尝试之前会利用 `hasQueuedPredecessors()` 方法来判断 AQS 的队列中中是否有其他线程,如果有则就不会尝试获取锁了(**这是公平锁特有的情况**)。
100100

0 commit comments

Comments
 (0)