Canceled tasks should be immediately removed from the work queue at time of cancellation.
This commit is contained in:
@@ -62,6 +62,7 @@ public final class ThreadPool
|
|||||||
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
||||||
{
|
{
|
||||||
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
||||||
|
threadPool.setRemoveOnCancelPolicy(true);
|
||||||
threadPool.prestartAllCoreThreads();
|
threadPool.prestartAllCoreThreads();
|
||||||
}
|
}
|
||||||
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
||||||
|
@@ -62,6 +62,7 @@ public final class ThreadPool
|
|||||||
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
||||||
{
|
{
|
||||||
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
||||||
|
threadPool.setRemoveOnCancelPolicy(true);
|
||||||
threadPool.prestartAllCoreThreads();
|
threadPool.prestartAllCoreThreads();
|
||||||
}
|
}
|
||||||
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
||||||
|
@@ -62,6 +62,7 @@ public final class ThreadPool
|
|||||||
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
||||||
{
|
{
|
||||||
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
||||||
|
threadPool.setRemoveOnCancelPolicy(true);
|
||||||
threadPool.prestartAllCoreThreads();
|
threadPool.prestartAllCoreThreads();
|
||||||
}
|
}
|
||||||
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
||||||
|
@@ -62,6 +62,7 @@ public final class ThreadPool
|
|||||||
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
||||||
{
|
{
|
||||||
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
||||||
|
threadPool.setRemoveOnCancelPolicy(true);
|
||||||
threadPool.prestartAllCoreThreads();
|
threadPool.prestartAllCoreThreads();
|
||||||
}
|
}
|
||||||
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
||||||
|
@@ -62,6 +62,7 @@ public final class ThreadPool
|
|||||||
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
||||||
{
|
{
|
||||||
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
||||||
|
threadPool.setRemoveOnCancelPolicy(true);
|
||||||
threadPool.prestartAllCoreThreads();
|
threadPool.prestartAllCoreThreads();
|
||||||
}
|
}
|
||||||
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
||||||
|
@@ -62,6 +62,7 @@ public final class ThreadPool
|
|||||||
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
||||||
{
|
{
|
||||||
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
||||||
|
threadPool.setRemoveOnCancelPolicy(true);
|
||||||
threadPool.prestartAllCoreThreads();
|
threadPool.prestartAllCoreThreads();
|
||||||
}
|
}
|
||||||
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
||||||
|
@@ -62,6 +62,7 @@ public final class ThreadPool
|
|||||||
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
||||||
{
|
{
|
||||||
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
||||||
|
threadPool.setRemoveOnCancelPolicy(true);
|
||||||
threadPool.prestartAllCoreThreads();
|
threadPool.prestartAllCoreThreads();
|
||||||
}
|
}
|
||||||
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
||||||
|
@@ -62,6 +62,7 @@ public final class ThreadPool
|
|||||||
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
||||||
{
|
{
|
||||||
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
||||||
|
threadPool.setRemoveOnCancelPolicy(true);
|
||||||
threadPool.prestartAllCoreThreads();
|
threadPool.prestartAllCoreThreads();
|
||||||
}
|
}
|
||||||
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
||||||
|
@@ -62,6 +62,7 @@ public final class ThreadPool
|
|||||||
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
||||||
{
|
{
|
||||||
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
||||||
|
threadPool.setRemoveOnCancelPolicy(true);
|
||||||
threadPool.prestartAllCoreThreads();
|
threadPool.prestartAllCoreThreads();
|
||||||
}
|
}
|
||||||
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
||||||
|
@@ -62,6 +62,7 @@ public final class ThreadPool
|
|||||||
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
||||||
{
|
{
|
||||||
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
||||||
|
threadPool.setRemoveOnCancelPolicy(true);
|
||||||
threadPool.prestartAllCoreThreads();
|
threadPool.prestartAllCoreThreads();
|
||||||
}
|
}
|
||||||
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
||||||
|
@@ -62,6 +62,7 @@ public final class ThreadPool
|
|||||||
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
||||||
{
|
{
|
||||||
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
||||||
|
threadPool.setRemoveOnCancelPolicy(true);
|
||||||
threadPool.prestartAllCoreThreads();
|
threadPool.prestartAllCoreThreads();
|
||||||
}
|
}
|
||||||
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
||||||
|
@@ -62,6 +62,7 @@ public final class ThreadPool
|
|||||||
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
||||||
{
|
{
|
||||||
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
||||||
|
threadPool.setRemoveOnCancelPolicy(true);
|
||||||
threadPool.prestartAllCoreThreads();
|
threadPool.prestartAllCoreThreads();
|
||||||
}
|
}
|
||||||
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
||||||
|
@@ -62,6 +62,7 @@ public final class ThreadPool
|
|||||||
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
||||||
{
|
{
|
||||||
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
||||||
|
threadPool.setRemoveOnCancelPolicy(true);
|
||||||
threadPool.prestartAllCoreThreads();
|
threadPool.prestartAllCoreThreads();
|
||||||
}
|
}
|
||||||
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
||||||
|
@@ -62,6 +62,7 @@ public final class ThreadPool
|
|||||||
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS)
|
||||||
{
|
{
|
||||||
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl());
|
||||||
|
threadPool.setRemoveOnCancelPolicy(true);
|
||||||
threadPool.prestartAllCoreThreads();
|
threadPool.prestartAllCoreThreads();
|
||||||
}
|
}
|
||||||
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
for (ThreadPoolExecutor threadPool : INSTANT_POOLS)
|
||||||
|
Reference in New Issue
Block a user