Skip to content

Commit

Permalink
Add comment on why we use at least two threads.
Browse files Browse the repository at this point in the history
  • Loading branch information
leMaik authored Oct 3, 2023
1 parent 9a22eaf commit 3fb6721
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions chunky/src/java/se/llbit/chunky/main/Chunky.java
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ public void update() {
*/
public static ForkJoinPool getCommonThreads() {
if (commonThreads == null) {
// use at least two threads to prevent deadlocks in some java versions (see #1631)
commonThreads = new ForkJoinPool(Math.max(PersistentSettings.getNumThreads(), 2));
}
return commonThreads;
Expand Down

0 comments on commit 3fb6721

Please sign in to comment.