Skip to content

Commit 26b2043

Browse files
author
ZhouLiMing
committed
fix AQS.md->CyclicBarrier 的使用示例demo程序示例错误
1 parent 534c942 commit 26b2043

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Java相关/Multithread/AQS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ public class CyclicBarrierExample2 {
336336
public static void test(int threadnum) throws InterruptedException, BrokenBarrierException {
337337
System.out.println("threadnum:" + threadnum + "is ready");
338338
try {
339-
cyclicBarrier.await(2000, TimeUnit.MILLISECONDS);
339+
/**等待60秒,保证子线程完全执行结束*/
340+
cyclicBarrier.await(60, TimeUnit.SECONDS);
340341
} catch (Exception e) {
341342
System.out.println("-----CyclicBarrierException------");
342343
}

0 commit comments

Comments
 (0)