Skip to content

Commit bd68fe6

Browse files
authored
Merge pull request Snailclimb#176 from GongFuBoy/master
Fix AQS.md->CyclicBarrier 的使用示例demo程序示例错误
2 parents 693208b + 26b2043 commit bd68fe6

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)