Skip to content

Commit

Permalink
Issue #16: fix for java 10: change order of pool size setter calls de…
Browse files Browse the repository at this point in the history
…pending on whether we're growing or shrinking
  • Loading branch information
codeforkjeff committed Sep 15, 2018
1 parent bced9fa commit 51c53d3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/com/codefork/refine/ThreadPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,13 @@ public int getPoolSize() {
}

public void setPoolSize(int newSize) {
executor.setCorePoolSize(newSize);
executor.setMaximumPoolSize(newSize);
if(newSize > executor.getCorePoolSize()) {
executor.setMaximumPoolSize(newSize);
executor.setCorePoolSize(newSize);
} else {
executor.setCorePoolSize(newSize);
executor.setMaximumPoolSize(newSize);
}
}

/**
Expand Down

0 comments on commit 51c53d3

Please sign in to comment.