Skip to content

Commit 538dfe2

Browse files
committed
fix a potential dead lock, TaskConvergence when then number of core processor is greater than 4, main thread will be blocked
1 parent 39c2c0d commit 538dfe2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/br/com/leonardoz/patterns/task_convergence/TaskConvergence.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class TaskConvergence {
6060
public TaskConvergence() {
6161
barrier = new CyclicBarrier(CORES, onComplete);
6262
synchronizedLinkedList = Collections.synchronizedList(new LinkedList<>());
63-
executor = Executors.newFixedThreadPool(4);
63+
executor = Executors.newFixedThreadPool(CORES);
6464
}
6565

6666
public void run() {

0 commit comments

Comments
 (0)