Skip to content

Commit f3740d1

Browse files
authored
Merge pull request Snailclimb#1756 from chang-kun/patch-1
Update tryAcquireShared Returns
2 parents e9a927e + 8e3b9eb commit f3740d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/java/concurrent/aqs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ final boolean nonfairTryAcquire(int acquires) {
209209
```java
210210
protected boolean tryAcquire(int)//独占方式。尝试获取资源,成功则返回true,失败则返回false。
211211
protected boolean tryRelease(int)//独占方式。尝试释放资源,成功则返回true,失败则返回false。
212-
protected boolean tryAcquireShared(int)//共享方式。尝试获取资源。负数表示失败;0表示成功,但没有剩余可用资源;正数表示成功,且有剩余资源。
212+
protected int tryAcquireShared(int)//共享方式。尝试获取资源。负数表示失败;0表示成功,但没有剩余可用资源;正数表示成功,且有剩余资源。
213213
protected boolean tryReleaseShared(int)//共享方式。尝试释放资源,成功则返回true,失败则返回false。
214214
protected boolean isHeldExclusively()//该线程是否正在独占资源。只有用到condition才需要去实现它。
215215
```

0 commit comments

Comments
 (0)