Minor ThreadUtil reformat

This commit is contained in:
James Seibel
2024-01-14 13:49:39 -06:00
parent fe9695e889
commit 79b0b3dc0a
2 changed files with 14 additions and 5 deletions
@@ -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-";
}
@@ -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<Double> 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); }