From 71568c1a02c27662b44919dde6cb24dc10022590 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Fri, 17 May 2019 00:20:38 +0000 Subject: [PATCH] Canceled tasks should be immediately removed from the work queue at time of cancellation. --- .../java/org/l2jmobius/commons/concurrent/ThreadPool.java | 1 + .../java/org/l2jmobius/commons/concurrent/ThreadPool.java | 1 + .../java/org/l2jmobius/commons/concurrent/ThreadPool.java | 1 + .../java/org/l2jmobius/commons/concurrent/ThreadPool.java | 1 + .../java/org/l2jmobius/commons/concurrent/ThreadPool.java | 1 + .../java/org/l2jmobius/commons/concurrent/ThreadPool.java | 1 + .../java/org/l2jmobius/commons/concurrent/ThreadPool.java | 1 + .../java/org/l2jmobius/commons/concurrent/ThreadPool.java | 1 + .../java/org/l2jmobius/commons/concurrent/ThreadPool.java | 1 + .../java/org/l2jmobius/commons/concurrent/ThreadPool.java | 1 + .../java/org/l2jmobius/commons/concurrent/ThreadPool.java | 1 + .../java/org/l2jmobius/commons/concurrent/ThreadPool.java | 1 + .../java/org/l2jmobius/commons/concurrent/ThreadPool.java | 1 + .../java/org/l2jmobius/commons/concurrent/ThreadPool.java | 1 + 14 files changed, 14 insertions(+) diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/concurrent/ThreadPool.java index 4f1103abe9..1eae3538ad 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/concurrent/ThreadPool.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/concurrent/ThreadPool.java @@ -62,6 +62,7 @@ public final class ThreadPool for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS) { threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl()); + threadPool.setRemoveOnCancelPolicy(true); threadPool.prestartAllCoreThreads(); } for (ThreadPoolExecutor threadPool : INSTANT_POOLS) diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/concurrent/ThreadPool.java index 4f1103abe9..1eae3538ad 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/concurrent/ThreadPool.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/concurrent/ThreadPool.java @@ -62,6 +62,7 @@ public final class ThreadPool for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS) { threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl()); + threadPool.setRemoveOnCancelPolicy(true); threadPool.prestartAllCoreThreads(); } for (ThreadPoolExecutor threadPool : INSTANT_POOLS) diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/concurrent/ThreadPool.java index 4f1103abe9..1eae3538ad 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/concurrent/ThreadPool.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/concurrent/ThreadPool.java @@ -62,6 +62,7 @@ public final class ThreadPool for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS) { threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl()); + threadPool.setRemoveOnCancelPolicy(true); threadPool.prestartAllCoreThreads(); } for (ThreadPoolExecutor threadPool : INSTANT_POOLS) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/concurrent/ThreadPool.java index 4f1103abe9..1eae3538ad 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/concurrent/ThreadPool.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/concurrent/ThreadPool.java @@ -62,6 +62,7 @@ public final class ThreadPool for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS) { threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl()); + threadPool.setRemoveOnCancelPolicy(true); threadPool.prestartAllCoreThreads(); } for (ThreadPoolExecutor threadPool : INSTANT_POOLS) diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/concurrent/ThreadPool.java index 4f1103abe9..1eae3538ad 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/concurrent/ThreadPool.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/concurrent/ThreadPool.java @@ -62,6 +62,7 @@ public final class ThreadPool for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS) { threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl()); + threadPool.setRemoveOnCancelPolicy(true); threadPool.prestartAllCoreThreads(); } for (ThreadPoolExecutor threadPool : INSTANT_POOLS) diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/concurrent/ThreadPool.java index 4f1103abe9..1eae3538ad 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/concurrent/ThreadPool.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/concurrent/ThreadPool.java @@ -62,6 +62,7 @@ public final class ThreadPool for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS) { threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl()); + threadPool.setRemoveOnCancelPolicy(true); threadPool.prestartAllCoreThreads(); } for (ThreadPoolExecutor threadPool : INSTANT_POOLS) diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/concurrent/ThreadPool.java index 4f1103abe9..1eae3538ad 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/concurrent/ThreadPool.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/concurrent/ThreadPool.java @@ -62,6 +62,7 @@ public final class ThreadPool for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS) { threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl()); + threadPool.setRemoveOnCancelPolicy(true); threadPool.prestartAllCoreThreads(); } for (ThreadPoolExecutor threadPool : INSTANT_POOLS) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/concurrent/ThreadPool.java index 4f1103abe9..1eae3538ad 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/concurrent/ThreadPool.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/concurrent/ThreadPool.java @@ -62,6 +62,7 @@ public final class ThreadPool for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS) { threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl()); + threadPool.setRemoveOnCancelPolicy(true); threadPool.prestartAllCoreThreads(); } for (ThreadPoolExecutor threadPool : INSTANT_POOLS) diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/commons/concurrent/ThreadPool.java index 0c67410a87..c70afed3a1 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/commons/concurrent/ThreadPool.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/commons/concurrent/ThreadPool.java @@ -62,6 +62,7 @@ public final class ThreadPool for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS) { threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl()); + threadPool.setRemoveOnCancelPolicy(true); threadPool.prestartAllCoreThreads(); } for (ThreadPoolExecutor threadPool : INSTANT_POOLS) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/commons/concurrent/ThreadPool.java index 4f1103abe9..1eae3538ad 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/commons/concurrent/ThreadPool.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/commons/concurrent/ThreadPool.java @@ -62,6 +62,7 @@ public final class ThreadPool for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS) { threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl()); + threadPool.setRemoveOnCancelPolicy(true); threadPool.prestartAllCoreThreads(); } for (ThreadPoolExecutor threadPool : INSTANT_POOLS) diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/commons/concurrent/ThreadPool.java index 0c67410a87..c70afed3a1 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/commons/concurrent/ThreadPool.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/commons/concurrent/ThreadPool.java @@ -62,6 +62,7 @@ public final class ThreadPool for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS) { threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl()); + threadPool.setRemoveOnCancelPolicy(true); threadPool.prestartAllCoreThreads(); } for (ThreadPoolExecutor threadPool : INSTANT_POOLS) diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/commons/concurrent/ThreadPool.java index 0c67410a87..c70afed3a1 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/commons/concurrent/ThreadPool.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/commons/concurrent/ThreadPool.java @@ -62,6 +62,7 @@ public final class ThreadPool for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS) { threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl()); + threadPool.setRemoveOnCancelPolicy(true); threadPool.prestartAllCoreThreads(); } for (ThreadPoolExecutor threadPool : INSTANT_POOLS) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/commons/concurrent/ThreadPool.java index 0c67410a87..c70afed3a1 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/commons/concurrent/ThreadPool.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/commons/concurrent/ThreadPool.java @@ -62,6 +62,7 @@ public final class ThreadPool for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS) { threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl()); + threadPool.setRemoveOnCancelPolicy(true); threadPool.prestartAllCoreThreads(); } for (ThreadPoolExecutor threadPool : INSTANT_POOLS) diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/commons/concurrent/ThreadPool.java index 0c67410a87..c70afed3a1 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/commons/concurrent/ThreadPool.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/commons/concurrent/ThreadPool.java @@ -62,6 +62,7 @@ public final class ThreadPool for (ScheduledThreadPoolExecutor threadPool : SCHEDULED_POOLS) { threadPool.setRejectedExecutionHandler(new RejectedExecutionHandlerImpl()); + threadPool.setRemoveOnCancelPolicy(true); threadPool.prestartAllCoreThreads(); } for (ThreadPoolExecutor threadPool : INSTANT_POOLS)