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
|
@Override
|
||||||
public boolean isRunning() {
|
public boolean isRunning() {
|
||||||
return this.triggerLifecycle.isRunning();
|
return (this.triggerLifecycle.isRunning() || this.fixedDelayLifecycle.isRunning());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -364,7 +364,6 @@ public class SimpleAsyncTaskExecutor extends CustomizableThreadCreator
|
||||||
this.active = false;
|
this.active = false;
|
||||||
Set<Thread> threads = this.activeThreads;
|
Set<Thread> threads = this.activeThreads;
|
||||||
if (threads != null) {
|
if (threads != null) {
|
||||||
threads.forEach(Thread::interrupt);
|
|
||||||
synchronized (threads) {
|
synchronized (threads) {
|
||||||
try {
|
try {
|
||||||
if (!threads.isEmpty()) {
|
if (!threads.isEmpty()) {
|
||||||
|
@ -375,6 +374,7 @@ public class SimpleAsyncTaskExecutor extends CustomizableThreadCreator
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
threads.forEach(Thread::interrupt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue