Skip to content

Commit eabda36

Browse files
committed
Notify all workers when adjusting thread count
If we decreased the number of workers, then it may be possible that the remaining workers are parked and need to drain tasks.
1 parent cff34f3 commit eabda36

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/main/java/ca/spottedleaf/concurrentutil/executor/thread/BalancedPrioritisedThreadPool.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ public void adjustThreadCount(final int threads) {
199199
}
200200
}
201201
}
202+
203+
for (final WorkerThread thread : this.threads.getArray()) {
204+
thread.notifyTasks();
205+
}
202206
}
203207

204208
public OrderedStreamGroup createOrderedStreamGroup() {

0 commit comments

Comments
 (0)