Skip to content

Commit

Permalink
fix manager thread block logic
Browse files Browse the repository at this point in the history
  • Loading branch information
gh-orange committed Dec 28, 2018
1 parent 768373f commit d1d30f5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/pers/cz/chaoxing/thread/manager/ManagerModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public abstract class ManagerModel implements PauseCallBack, Runnable, Closeable

@Override
public final void run() {
if (this.threadPoolSize > 0)
if (this.threadPoolSize > 0) {
try {
doJob();
} catch (RequestsException e) {
Expand All @@ -48,6 +48,14 @@ public final void run() {
threadPool.shutdownNow();
} catch (Exception ignored) {
}
LongStream.range(0, threadPool.getTaskCount()).mapToObj(i -> {
try {
return completionService.take().get();
} catch (Exception e) {
return false;
}
});
}
}

@Override
Expand Down

0 comments on commit d1d30f5

Please sign in to comment.