diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java index 8e35bebcd..6665b77be 100644 --- a/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java +++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java @@ -49,6 +49,6 @@ public final class ModInfo public static final String MULTIVERSE_PLUGIN_NAMESPACE = "world_control"; /** All DH owned threads should start with this string to allow for easier debugging and profiling. */ - public static String THREAD_NAME_PREFIX = "DH-"; + public static final String THREAD_NAME_PREFIX = "DH-"; } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/ThreadUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/ThreadUtil.java index eacd25811..c71ff0710 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/ThreadUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/ThreadUtil.java @@ -34,12 +34,13 @@ import java.util.concurrent.*; * Handles thread pool creation. * * @see ThreadPools + * @see TimerUtil */ public class ThreadUtil { private static final Logger LOGGER = LogManager.getLogger(); - public static String THREAD_NAME_PREFIX = ModInfo.THREAD_NAME_PREFIX; + public static final String THREAD_NAME_PREFIX = ModInfo.THREAD_NAME_PREFIX; public static int MINIMUM_RELATIVE_PRIORITY = -4; public static int DEFAULT_RELATIVE_PRIORITY = 0; @@ -51,7 +52,9 @@ public class ThreadUtil - // rate limited thread pool // + //===================// + // rate limited pool // + //===================// public static RateLimitedThreadPoolExecutor makeRateLimitedThreadPool(int poolSize, DhThreadFactory threadFactory, ConfigEntry runTimeRatioConfigEntry, Semaphore activeThreadCountSemaphore) { @@ -90,7 +93,10 @@ public class ThreadUtil } - // thread pool executor // + + //===============// + // standard pool // + //===============// public static ThreadPoolExecutor makeThreadPool(int poolSize, String name, int relativePriority) { @@ -108,7 +114,10 @@ public class ThreadUtil public static ThreadPoolExecutor makeThreadPool(int poolSize, Class clazz) { return makeThreadPool(poolSize, clazz.getSimpleName(), DEFAULT_RELATIVE_PRIORITY); } - // single thread pool executor // + + //====================// + // single thread pool // + //====================// public static ThreadPoolExecutor makeSingleThreadPool(String name, int relativePriority) { return makeThreadPool(1, name, relativePriority); } public static ThreadPoolExecutor makeSingleThreadPool(Class clazz, int relativePriority) { return makeThreadPool(1, clazz.getSimpleName(), relativePriority); }