mirror of
https://gitee.com/jd-platform-opensource/asyncTool.git
synced 2024-12-31 15:35:34 +08:00
chore: 简化判断
This commit is contained in:
parent
5efb329f9c
commit
6b546bc7a4
@ -136,10 +136,8 @@ public class Async {
|
||||
//任务结束就退出检查
|
||||
if (onceWork.isFinish()) {
|
||||
break;
|
||||
}
|
||||
//完成或者取消就及时取消任务
|
||||
if (!onceWork.isFinish()
|
||||
&& onceWork.getAllThreadSubmit().stream().allMatch(future -> future.isDone() || future.isCancelled())) {
|
||||
} else if (onceWork.getAllThreadSubmit().stream().allMatch(future -> future.isDone() || future.isCancelled())) {
|
||||
//完成或者取消就及时取消任务
|
||||
if (!onceWork.isCancelled() && !onceWork.isWaitingCancel()) {
|
||||
onceWork.pleaseCancel();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user