Align task execution tracking and thread interruption on shutdown
Closes gh-35254
This commit is contained in:
parent
24e66b63d1
commit
67e88f3c20
|
@ -376,7 +376,7 @@ public class SimpleAsyncTaskScheduler extends SimpleAsyncTaskExecutor implements
|
|||
|
||||
@Override
|
||||
public boolean isRunning() {
|
||||
return this.triggerLifecycle.isRunning();
|
||||
return (this.triggerLifecycle.isRunning() || this.fixedDelayLifecycle.isRunning());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -364,7 +364,6 @@ public class SimpleAsyncTaskExecutor extends CustomizableThreadCreator
|
|||
this.active = false;
|
||||
Set<Thread> threads = this.activeThreads;
|
||||
if (threads != null) {
|
||||
threads.forEach(Thread::interrupt);
|
||||
synchronized (threads) {
|
||||
try {
|
||||
if (!threads.isEmpty()) {
|
||||
|
@ -375,6 +374,7 @@ public class SimpleAsyncTaskExecutor extends CustomizableThreadCreator
|
|||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
threads.forEach(Thread::interrupt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue