Fix thread priority

This commit is contained in:
Sotr
2019-03-28 13:55:50 +08:00
parent ce6270f9c8
commit 69b28780a5
2 changed files with 2 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ public class AkarinAsyncScheduler extends Thread {
instance = new AkarinAsyncScheduler();
instance.setName("Akarin Async Scheduler Thread");
instance.setDaemon(true);
instance.setPriority(MIN_PRIORITY);
instance.start();
LOGGER.info("Async executor started");
}

View File

@@ -795,6 +795,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
// Spigot start
org.spigotmc.WatchdogThread.hasStarted = true; // Paper
io.akarin.server.core.AkarinAsyncScheduler.initalise(); // Akarin
Thread.currentThread().setPriority(Thread.MAX_PRIORITY); // Akarin
Arrays.fill( recentTps, 20 );
long start = System.nanoTime(), curTime, wait, tickSection = start; // Paper - Further improve server tick loop
lastTick = start - TICK_TIME; // Paper