File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public abstract class AbstractQueuedSynchronizer extends AbstractOwnableSynchron
18
18
}
19
19
```
20
20
21
- AQS 为构建锁和同步器提供了一些通用功能的是实现 ,因此,使用 AQS 能简单且高效地构造出应用广泛的大量的同步器,比如我们提到的 ` ReentrantLock ` ,` Semaphore ` ,其他的诸如 ` ReentrantReadWriteLock ` ,` SynchronousQueue ` 等等皆是基于 AQS 的。
21
+ AQS 为构建锁和同步器提供了一些通用功能的实现 ,因此,使用 AQS 能简单且高效地构造出应用广泛的大量的同步器,比如我们提到的 ` ReentrantLock ` ,` Semaphore ` ,其他的诸如 ` ReentrantReadWriteLock ` ,` SynchronousQueue ` 等等皆是基于 AQS 的。
22
22
23
23
## AQS 原理
24
24
@@ -582,7 +582,7 @@ public int await() throws InterruptedException, BrokenBarrierException {
582
582
breakBarrier();
583
583
throw new InterruptedException ();
584
584
}
585
- // cout减1
585
+ // count 减1
586
586
int index = -- count;
587
587
// 当 count 数量减为 0 之后说明最后一个线程已经到达栅栏了,也就是达到了可以执行await 方法之后的条件
588
588
if (index == 0 ) { // tripped
You can’t perform that action at this time.
0 commit comments